Name
GtkMenuItem -- the widget used for item in menus
Description
The GtkMenuItem widget and the derived widgets are the only valid
childs for menus. Their function is to correctly handle highlighting,
alignment, events and submenus.
As it derives from GtkBin it can hold any valid child widget, altough
only a few are really useful.
Details
gtk_menu_item_new_with_label ()
GtkWidget* gtk_menu_item_new_with_label (const gchar *label); |
Creates a new GtkMenuItem whose child is a GtkLabel.
gtk_menu_item_set_submenu ()
Sets the widget submenu, or changes it.
gtk_menu_item_remove_submenu ()
void gtk_menu_item_remove_submenu (GtkMenuItem *menu_item); |
Removes the widget's submenu.
gtk_menu_item_set_placement ()
Specifies the placement of the submenu around the menu item. The placement
is usually GTK_LEFT_RIGHT for menu items in a popup menu and
GTK_TOP_BOTTOM in menu bars.
This function is useless in usual applications.
gtk_menu_item_configure ()
void gtk_menu_item_configure (GtkMenuItem *menu_item,
gboolean show_toggle_indicator,
gboolean show_submenu_indicator); |
Sets whether the menu item should show a submenu indicator, which is a right
arrow.
gtk_menu_item_select ()
Emits the "select" signal on the given item. Behaves exactly like
gtk_item_select.
gtk_menu_item_deselect ()
Emits the "deselect" signal on the given item. Behaves exactly like
gtk_item_deselect.
gtk_menu_item_activate ()
Emits the "activate" signal on the given item
gtk_menu_item_toggle_size_request ()
void gtk_menu_item_toggle_size_request
(GtkMenuItem *menu_item,
gint *requisition); |
gtk_menu_item_toggle_size_allocate ()
void gtk_menu_item_toggle_size_allocate
(GtkMenuItem *menu_item,
gint allocation); |
gtk_menu_item_right_justify ()
void gtk_menu_item_right_justify (GtkMenuItem *menu_item); |
Sets the menu item to be right-justified. Only useful for menu bars.
Signals
The "activate" signal
void user_function (GtkMenuItem *menuitem,
gpointer user_data); |
Emitted when the item is activated.
The "activate-item" signal
void user_function (GtkMenuItem *menuitem,
gpointer user_data); |
Emitted when the item is activated, but also if the menu item has a
submenu. For normal applications, the relevant signal is "activate".
The "toggle-size-allocate" signal
void user_function (GtkMenuItem *menuitem,
gint arg1,
gpointer user_data); |
The "toggle-size-request" signal
void user_function (GtkMenuItem *menuitem,
gpointer arg1,
gpointer user_data); |