Re: [gtk-list] GtkItemFactoryEntry: no field for callback data?

On Wed, 13 Jan 1999, Andy Kahn wrote:

> just wondering where there is no provision for specifying callback
> data as part of GtkItemFactoryEntry... i think it would be good to
> have, since not all menu items may have identical callback data.
> without it, i'm finding flexibility somewhat limited.
> --andy

the item factory features two different types of callback_data, this is
the callback signature:

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

here, `callback_data' is the `callback_data' pointer that you passed into
gtk_item_factory_create_items() or gtk_item_factory_create_item().
`callback_action' is the value of GtkItemFactoryEntry.callback_action, thus
it's always menu item specific. `widget' is a pointer to the menu item that
got selected, and the factory itself can be retrived back from this widget
via gtk_item_factory_from_widget().

> -- 
> To unsubscribe: mail -s unsubscribe < /dev/null


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