Re: [gtk-list] Re: ItemFactory anyone?



On 01/14/99 Jan Kratochvil uttered the following other thing:
> 
>   It's just ineffective (but surely better than the glist solution). BTW
> (maintainers, listen... :-) ) does anyone know why the hell it is defined
> as guint and not gpointer and why it is named "action" and not "data" as
> usual in other places of GTK+? Wasn't it meant as for some other meaning?

This was my first thought, but then I looked closer at the
implementation of gtkitemfactory.c and found:
struct _GtkIFCBData
{
  GtkItemFactoryCallback  func;
  guint                   callback_type;
  gpointer                func_data;
  guint                   callback_action;
};

And the function:
void    gtk_item_factory_create_item    (GtkItemFactory *ifactory,
                                         GtkItemFactoryEntry    *entry,
					 gpointer callback_data,
					 guint callback_type);

And, looking at the callbacks:
typedef void    (*GtkItemFactoryCallback1) (gpointer callback_data,
                                            guint callback_action,
					    GtkWidget *widget);
typedef void    (*GtkItemFactoryCallback2) (GtkWidget *widget,
                                            gpointer callback_data,
					    guint callback_action);

>From this, we can see that there is both an action and data, but I don't
know what the distinction is, and you can't add the data to the
ItemFactorEntry.

In my program, I was generating the menu from a configuration file, and
creating a MenuEntry list to generate the menu, but it appears
that I need to directly create the menu now, as the ItemFactory doesn't
allow you to specify the data any more.  I have another program where I
filled in the data portion of the MenuEntry structure at run-time, and
now I can't use that either.

Also, there is a lot more in the ItemFactory code, including parsing
strings?  So, is there any documentation or comments from people who
wrote it?

Brandon
-- 
Brandon Long (blong@fiction.net)             [http://www.fiction.net/blong/]

  "Hockey is a lot like chess on ice.  Or it would be, if the excitement of 
   chess was based on when the guy with the white pieces shoves his bishop 
   up the other guy's ass and breaks his neck with a big wooden stick."
                                              -- Stewart King



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