I have created a GtkMenu with 10 GtkMenuItems in it, and attached activate
event to each menu item, but in callback function how should I get to know which menu item was actually selected?
I have added Call back to GtkMenuItem as follows:
gtk_signal_connect_object( GTK_OBJECT(menu_items), "activate",
GTK_SIGNAL_FUNC(on_option_selected),
(gpointer)GINT_TO_POINTER( i ) );
and my call back function is as follows:
gboolean on_option_selected( GtkWidget *widget, gpointer user_data );
And tried to convert user_data as follows but getting garbage.
gint selected_index = GPOINTER_TO_INT( user_data );
Thanks, PP