Re: GtkOptionMenu
- From: John Cupitt <john cupitt ng-london org uk>
- To: Matt Hillebrand <hill9361 uidaho edu>
- Cc: gtk-list gnome org
- Subject: Re: GtkOptionMenu
- Date: Mon, 05 Mar 2001 10:32:25 +0000
Matt Hillebrand wrote:
> 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.
Hi Matt, connect to the menu items, something like this:
--
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 );
--
HTH, John
--
John Cupitt, john cupitt ng-london org uk, +44 (0)20 7747 2570
VASARI Lab, The National Gallery, Trafalgar Square, London, WC2N 5DN
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]