Option Menus

I am using the Glade tool to build GTK code. I would like to maintain the
capability of using the Glade tool for future add-ons and changes, therefore
I don't want to change the Glade created interface.c file. The problem I am
having is regarding option menus.  I did change the interface.c file in
order to try John Cupitt's suggestion in response to the question: I can't
connect any signal handlers to my Option Menu. The API says that it is
derived from a button, but none of the button signals seem to work.

John's suggestion:
       GtkWidget *option = gtk_option_menu_new();
        GtkWidget *pane = gtk_menu_new();

        for( i = 0; i < nitems; i++ ) {
                GtkWidget *item = gtk_menu_item_new_with_label( label[i]);
                gtk_signal_connect( GTK_OBJECT( item ),
                        "activate", GTK_SIGNAL_FUNC( option_cb ), XXX );
                gtk_menu_append( GTK_MENU( pane ), item );

        gtk_widget_show_all( pane );
        gtk_option_menu_set_menu( GTK_OPTION_MENU( option ), pane );

but I get the following warning when I execute the created executable: 

      GTK-WARNING **:  gtk_signal_connect(): could not find signal
"activate" in the 'GtkOptionMenu' class       ancestry

also, the option menu doesn't respond to signal inputs, i.e. mouse clicks.
Other suggestions would be greatly appreciated.

(972)603-3381 wk
(972)603-9013 fax
claire a misquez lmco com

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