Gtk--: determining Gtk_OptionMenu choice



Hi,

I'm using a Gtk_OptionMenu (Gtk+1.0.5, Gtk--0.9.11) and even though the
basic thing seems to work, I can't quite figure out how to get the option
menu's choice back once it's been selected.

I'm doing the following:

------------------------------------------------------------------------

Gtk_OptionMenu           d_colormapOptMenu;
Gtk_Menu       d_colormapMenu;
Gtk_RadioMenuItem   *d_rmiGrayscale, *d_rmiColorBands;
Gtk_HBox       d_hbox;
Gtk_VBox       d_vbox;

... snip ...

d_rmiColorBands = new Gtk_RadioMenuItem  (d_colormapMenuGroup, "ColorBan
d_colormapMenuGroup = d_rmiColorBands->group ();
d_rmiColorBands->show ();
d_colormapMenu.append (d_rmiColorBands);

d_rmiGrayscale = new Gtk_RadioMenuItem  (d_colormapMenuGroup, "Grayscale
d_colormapMenuGroup = d_rmiGrayscale->group ();
d_rmiGrayscale->show ();
d_colormapMenu.append (d_rmiGrayscale);

d_colormapMenu.show ();
d_colormapOptMenu.set_menu (&d_colormapMenu);
d_hbox.pack_end (&d_colormapOptMenu, TRUE, FALSE, 10);
d_colormapOptMenu.show ();
d_vbox.pack_start (&d_hbox, TRUE, FALSE, 0);
d_hbox.show ();

... snip ...

------------------------------------------------------------------------

So once the user picks a choice of my option menu, how do I determine
the choice he made. I've looked at the gtk-- sources but everything
I've tried didn't work. Any help would be appreciated ...

Thanks
--> Robert




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