Details
gnome_popup_menu_new_with_accelgroup ()
GtkWidget* gnome_popup_menu_new_with_accelgroup
(GnomeUIInfo *uiinfo,
GtkAccelGroup *accelgroup); |
Creates a popup menu out of the specified uiinfo array. Use
gnome_popup_menu_do_popup() to pop the menu up, or attach it to a
window with gnome_popup_menu_attach().
gnome_popup_menu_get_accel_group ()
GtkAccelGroup* gnome_popup_menu_get_accel_group
(GtkMenu *menu); |
gnome_popup_menu_attach ()
void gnome_popup_menu_attach (GtkWidget *popup,
GtkWidget *widget,
gpointer user_data); |
Attaches the specified popup menu to the specified widget. The
menu can then be activated by pressing mouse button 3 over the
widget. When a menu item callback is invoked, the specified
user_data will be passed to it.
This function requires the widget to have its own window
(i.e. GTK_WIDGET_NO_WINDOW (widget) == FALSE), This function will
try to set the GDK_BUTTON_PRESS_MASK flag on the widget's event
mask if it does not have it yet; if this is the case, then the
widget must not be realized for it to work.
The popup menu can be attached to different widgets at the same
time. A reference count is kept on the popup menu; when all the
widgets it is attached to are destroyed, the popup menu will be
destroyed as well.
gnome_popup_menu_do_popup ()
void gnome_popup_menu_do_popup (GtkWidget *popup,
GtkMenuPositionFunc pos_func,
gpointer pos_data,
GdkEventButton *event,
gpointer user_data); |
You can use this function to pop up a menu. When a menu item *
callback is invoked, the specified user_data will be passed to it.
The pos_func and pos_data parameters are the same as for
gtk_menu_popup(), i.e. you can use them to specify a function to
position the menu explicitly. If you want the default position
(near the mouse), pass NULL for these parameters.
The event parameter is needed to figure out the mouse button that
activated the menu and the time at which this happened. If you
pass in NULL, then no button and the current time will be used as
defaults.
gnome_popup_menu_do_popup_modal ()
int gnome_popup_menu_do_popup_modal (GtkWidget *popup,
GtkMenuPositionFunc pos_func,
gpointer pos_data,
GdkEventButton *event,
gpointer user_data); |
Same as above, but runs the popup menu modally and returns the
index of the selected item, or -1 if none.