On Tue, 17 Oct 2000 16:31:49 -0600,
Joe Van Andel <[EMAIL PROTECTED]> said:

    > Unfortunately, I don't see how to do this. Glade is
    > creating three GtkMenuItem's associated with a GtkMenu. But
    > how do I retrieve the GtkMenuItem for a given choice? If I
    > could retrieve each of the GtkMenuItem's, I could attach to
    > the 'activate' signal on each.

You can set the signal handlers in Glade just like you would for
any other widget. You can select the menu item from the widget
tree, or from the option menu itself.

    > I have attached to the 'selection-done' signal of the
    > GtkMenu, but since I don't know the text associated with
    > the selected GtkMenuItem, it doesn't help:

Here's a function i wrote to fill in a whole in the GTK+ API
(which i believe has been filled for 2.0). It corresponds to
gtk_option_menu_set_history().

def optionmenu_get_history(self):
    menu = self.get_menu()
    children = menu.children()
    item = menu.get_active()

    for i in range(len(children)):
        if children[i] == item:
            break

    return i

-- 
Eric Gillespie, Jr. <*> [EMAIL PROTECTED]
Software Developer
Progeny Linux Systems - http://progeny.com


_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to