Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

problem with status bar

11 views
Skip to first unread message

psk

unread,
Dec 8, 2005, 7:34:22 AM12/8/05
to
Hi friends,

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.

psk

unread,
Dec 8, 2005, 7:55:38 AM12/8/05
to
can anyone give me the idea, how to do it?
as this is the urgent one.

thanks & regards
psk.

Bryan Oakley

unread,
Dec 8, 2005, 8:45:16 AM12/8/05
to
psk wrote:

> 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.

psk

unread,
Dec 8, 2005, 9:13:25 AM12/8/05
to
what you guessed is correct, that is what i exactly want,
and i 'll implement the way you are telling,
i 'll come back to you if i face any problem,

thanks a lot
regards
psk.

gamil...@gmail.com

unread,
Dec 9, 2005, 7:48:19 AM12/9/05
to
hi friend,

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

Bryan Oakley

unread,
Dec 9, 2005, 9:00:35 AM12/9/05
to
gamil...@gmail.com wrote:
> hi friend,
>
> i don't know how to have two label with status bar in mainframe?
> can u send me code snippet for this,

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.

0 new messages