Hi,
I want to create a menu with a group of radio menu items with the help of gtk_action_group_add_radio_actions as shown in the GnomeUIInfo migration guide.
void
gtk_action_group_add_radio_actions (GtkActionGroup *action_group,
const GtkRadioActionEntry *entries,
guint n_entries,
gint value,
GCallback on_change,
gpointer user_data);
It took long to find out that the callback function takes three arguments instead of two. Up to now I only saw that a gcallback function uses two arguments. But here the user data is received as the third argument:
void on_change(GtkAction *action, GtkRadioAction *item, gpointer *user_data) {...}
I realized this in the testmerge.c example in the gtk sources. There was no other hint, also not in the documentation.
To this I have two questions:
- How could I have find out that the callback function has three instead of two arguments when I want to use the user data? Is there a way to find this out?
- I actually expected the user data to be passed on the second argument position. In this case it should have been of type “GVIEWER_WINDOW”. I realized that this was not the case by checking the type with IS_GVIEWER_WINDOW (user_data). But how could I have find out that the seconde argument is of type GTK_RADIO_ACTION? Is there a method to get the name of a pointer type? If yes, how is that done?
Thank you in advance
Uwe