I am develeping GUI in tcltk, i have menu bar and status bar.
For menu item i have tool tip text,
and i have a form having button, when user presses the button i am
displaying some text in the status bar, and when a menu item is
selected it is replaced with the corresponding tool tip text of the
menu item,
i implemented the following code for the menu item,
set descmenu {
"&File" all file 0 {
{command "E&xit" {} "Exit BWidget demo" {} -command myExit}
}
}
set prgindic 0
set mainframe [MainFrame .mainframe \
-menu $descmenu \
-textvariable pekgui::status \
-progressvar pekgui::prgindic]
for the button press in another form,
set pekgui::status " $filname "
what i want is ,when user presses the menu item and if some text is
there in the status, then the tool tip text should be appended with
that,
can anyone help me in this regards?
thanks in advance.
regards
psk.
thanks & regards
psk.
> what i want is ,when user presses the menu item and if some text is
> there in the status, then the tool tip text should be appended with
> that,
>
> can anyone help me in this regards?
>
I don't fully understand the problem, and I've never used whatever form
of creating menus that you're using. Is that BWidgets? Regardless, I'll
take a stab at the problem since you seem anxious to get this solved,
judging by a followup 20 minutes later saying this was urgent.
Anyway, am I correct in guessing that you have some static text that may
appear in a statusbar, and when the mouse is over a button or menu you
want the statusbar to show both the static text and the tooltip?
The easiest way is just to create a statusbar with two labels -- one for
the static text and one for the tooltip. Is there a reason you want a
single variable to hold both?
Another solution is to not use the tooltip variable in your statusbar;
use some other variable for the statusbar. Place a trace on the tooltip
variable; when it changes, concat it with whatever else you want to
display in the statusbar and then set the statusbar variable accordingly.
thanks a lot
regards
psk.
i don't know how to have two label with status bar in mainframe?
can u send me code snippet for this,
or
some more explaination for this?
regards
psk
Have you tried reading the man page? The very first subcommand listed is
"addindicator", which adds another label in the status bar.
You are, of course, limited to the layout defined by the BWidgets code
-- that is, additional indicators may look different or go to a
different side of the statusbar than you wish) -- but that's what you
get when you use library procedures like MainFrame -- you lose a bit of
control in exchange for some convenience.
If this doesn't give you the look you want, personally I recommend not
using Mainframe and just creating the components individually. Or, take
a hybrid approach and use mainframe with the statusbar turned off
($mainframe showstatusbar "none") then add your own statusbar -- a frame
with as many embedded label widgets as you desire.