Re: [gtk-list] Option menus in GTK+



I suspect your best bet is just to keep track of the option menu's state in a
separate variable. You'll know the initial value of the option menu because
you set it up. Then whenever one of your option-menu-selection-triggered
functions gets called, you'll know the new state of the option menu because
(presumably) you know which state causes which function to be called. So you
have all the information you need to keep track of the option menu's settings.

John


Matthew D Allen wrote:

> About option menus - I can connect a signal to each menu item inside the
> optionmenu so that when it gets "activate" I can call a function of my
> choice.  the problem is that in this function, I also need to know what
> the state of the option menu was before it was changed.  Is there a way to
> do this?
>
> What I"m trying to do is this:  I've got an entry widget, and an option
> menu next to it.  The entry widget can hold 4 different things, depending
> on what the option menu is set to.  So what I need to do is when a new
> option menu setting is chosen, I need to save whatever was in the entry
> widget, and then clear it out for input on the next item corresponding to
> the option menu item that as chosen.  The saving is easy, and the clearing
> is easy, but when I move from one option menu item to the next, and I grab
> the text out of the box, I have to know what option menu setting that
> corresponded to before the change.  Is there a way to do that?  Basically,
> find out whatever the setting on the option menu was BEFORE the new
> setting?
>
> I know that's a convoluted question but it's as good as I can describe it.
> Any suggestions?
>
> David Allen
>
> http://opop.nols.com/ Free Software Development
> ==========================================================================
> Der Horizont vieler Menschen ist ein Kreis mit Radius Null -- und das
> nennen sie ihren Standpunkt.
> ==========================================================================
> perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'
>
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]