Re: How to pass data to GtkItemFactory callback function?



On Wed, 2002-11-06 at 15:33, David J. Topper wrote:
> Hello,
> 
> I'm using the simple method for the GtkItemFactory.  Namely:
> 
>   GtkItemFactoryEntry menu_items[] = {
>     { "/_File",         NULL,         NULL, 0, "<Branch>" },
>     { "/File/_Open",    "<control>O", open_file, 0, NULL },
> 
> and so on.  But I don't see how I can place a data pointer into this
> structure as I can with general gtk_signal_connect().  I do see,
> however, defs. in the GtkItemFactoryEtry spec off the docs:
> 
> struct GtkItemFactoryEntry
>  {
>    gchar *path;
>    gchar *accelerator;
> 
>    GtkItemFactoryCallback callback;
>    guint                  callback_action;
> 
> ...
> 
> and GtkItemFactoryCallback 1&2 have some args which would work.  But I'm
> at a loss to implement this.
> 

You can use  'gtk_item_factory_create_item()' instead of
'_create_items()'.
-- 
Stephen




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