Re: GtkItemFactory



That is the way to do it if you bear in mind two things.
1) An item factory callback has a different prototype than
a menu item callback.
2) That field is shared among all the callbacks you specify in the
GtkItemFactoryEntry array.

The most common error is number 1.  Here is the prototype for
an Item Factory Callback.....
  void (*GtkItemFactoryCallback1)( gpointer callback_data,
guint callback_action, GtkWidget *widget);

A bit different from a MenuItem callback.  Of course, if you don't like
this,
you could always retrieve the widget id from the item factory and
attach your callback manually.  Then you'd be using the GtkMenuItem's
callback prototype.

Does this make sense? Hope so, if not I'll try again.
Donna

----- Original Message -----
From: Ron Steinke <rsteinke merilon elfhame net>
To: <gtk-list gnome org>
Sent: Monday, November 20, 2000 12:11 PM
Subject: GtkItemFactory


> How do you pass a pointer to user data to callback functions
> called from a GtkMenuItem created by a GtkItemFactory? I tried
> passing it as the callback_data argument of gtk_item_factory_create_items,
> but this doesn't appear to by the way to do it.
> Ron Steinke
>
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
>





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