From GtkItemFactory to GtkUIManager & GtkActionGroup

Hi Everyone,
I am a newbie to GTK, and am currently porting an old app to GTK+-2.0
that had a heavy usage of GtkItemFactory in it. I am in midst of
converting it to make use of GtkUIManager & GtkActionGroup, as per
this tutorial:

Now, the struct 'GtkItemFactoryEntry' had these two elements:

  GtkItemFactoryCallback callback;
  guint			 callback_action;

where (as far as I understand) the 'callback_action' allowed using the
same callback to implement different actions. For example, if
GtkItemFactoryEntry had these two entries:

  {"/File/Open...", NULL, hit_key, (int)"@", NULL},
  {"/File/Save...", NULL, hit_key, (int)"#", NULL},

then in
hit_key(GtkWidget *w, gpointer data)

one can make use of ((char *)data)[0] to distinguish between the Open
& Save actions.

So, I now need to do something similar with 'GtkActionEntry' and an
XML based UI.... but the struct members (of 'GtkActionEntry') don't
seem to give that kind of functionality.
For standard actions (such as Open or Save only), I probably don't
need it anyhow, but for somthing that's app-specific, I don't
understand how it cane be implemented.
Can anyone help me, or tell me an alternative to this?

Thanks very much aprior,

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