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

Re: GtkItemFactoryEntry question



The widget supplied is the one which activated
the callback (GTK+ supplies this for you) - in this
case the New menu item since that's what you clicked
on to activate the hello function.

The gpointer data is supplied by you, in your
gtk_item_factory_create_items().  It's any data
you need to pass to the function (as long as it
fits in a gpointer).  My assumption is that your
hello isn't using this field, since it's prototype is
actually, according to the RDP :

void        (*GtkItemFactoryCallback1)      (gpointer callback_data,
                                             guint callback_action,
                                             GtkWidget *widget);

different from a typical widget signal handler......

Hope that helps.
Donna




----- Original Message -----
From: "Peter Jay Salzman" <p@dirac.org>
To: <gtk-app-devel-list@gnome.org>
Sent: Thursday, July 12, 2001 6:19 PM
Subject: GtkItemFactoryEntry question


> hi there,
>
> i'm trying to understand some code.  here are some entries in the menubar:
>
> static GtkItemFactoryEntry menu_items[] = {
>   { "/_File",         NULL,         NULL,          0, "<Branch>" },
>   { "/File/_New",     "<control>N", hello,         0, NULL },
> }
>
> however, the hello function takes two arguments:
>
> void hello( GtkWidget *widget, gpointer data );
>
> when the call to hello is made by clicking File | New, , what *widget gets
> passed?  and what data?  the menu item doesn't give any arguments.
>
> thanks!
> pete
>
> --
> "The following addresses had permanent fatal errors..."      p@dirac.org
>                                -- Mailer Daemon
www.dirac.org/p
>
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>





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