Jame Henstridge writes:
> On Wed, 14 Mar 2001 [EMAIL PROTECTED] wrote:
>
> > The child in a GtkOptionMenu is a GtkMenu with some GtkMenuItems , but
> > i want to set active a especific choice. i use gtk_menu.set_active(pos
> > index) but this don´t work. Thanks
>
> Either call the activate() method on the actual menu item, or use the
> option_menu.set_history(index) method on the option menu (the first is
> easier if you have a reference to the menu item, the second easier if you
> have its index).
Oddly, I can't get that to work. I do this:
print "using map",world
world[9].activate()
I get this printed:
using map [2.0, 0.0, 0.0, -2.0, 504400.0, 4953200.0, 400, 200,
'S=11&T=2&X=1262&Y=12382&Z=18&W=0', <gtk.GtkMenuItem instance at 813d988>]
And my GtkOptionMenu doesn't change. The menu works, in the sense
that I can click on it and change the values.
Also, glade isn't suggesting the signal "deactivate" even though Damon
himself suggested that someone could detect an OptionMenu change by
connecting to the deactivate signal:
window1 = create_window1 ();
option_menu = lookup_widget (window1, "optionmenu1");
gtk_signal_connect (GTK_OBJECT (GTK_OPTION_MENU (option_menu)->menu),
"deactivate", GTK_SIGNAL_FUNC (on_option_selected),
NULL);
--
-russ nelson will be speaking at http://www.osdn.com/conferences/brie/
Crynwr sells support for free software | PGPok | Watch out! He's got an
521 Pleasant Valley Rd. | +1 315 268 1925 voice | opinion, and he's not
Potsdam, NY 13676-3213 | +1 315 268 9201 FAX | afraid to share it!
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk