Top |
void | gtk_menu_shell_append () |
void | gtk_menu_shell_prepend () |
void | gtk_menu_shell_insert () |
void | gtk_menu_shell_deactivate () |
void | gtk_menu_shell_select_item () |
void | gtk_menu_shell_select_first () |
void | gtk_menu_shell_deselect () |
void | gtk_menu_shell_activate_item () |
void | gtk_menu_shell_cancel () |
void | gtk_menu_shell_set_take_focus () |
gboolean | gtk_menu_shell_get_take_focus () |
void | activate-current | Action |
void | cancel | Action |
void | cycle-focus | Action |
void | deactivate | Run First |
void | insert | Run First |
void | move-current | Action |
gboolean | move-selected | Run Last |
void | selection-done | Run First |
GObject ╰── GInitiallyUnowned ╰── GtkObject ╰── GtkWidget ╰── GtkContainer ╰── GtkMenuShell ├── GtkMenuBar ╰── GtkMenu
void gtk_menu_shell_insert (GtkMenuShell *menu_shell
,GtkWidget *child
,gint position
);
void gtk_menu_shell_select_item (GtkMenuShell *menu_shell
,GtkWidget *menu_item
);
void gtk_menu_shell_select_first (GtkMenuShell *menu_shell
,gboolean search_sensitive
);
Select the first visible or selectable child of the menu shell; don't select tearoff items unless the only item is a tearoff item.
menu_shell |
||
search_sensitive |
if |
Since: 2.2
void gtk_menu_shell_activate_item (GtkMenuShell *menu_shell
,GtkWidget *menu_item
,gboolean force_deactivate
);
void
gtk_menu_shell_cancel (GtkMenuShell *menu_shell
);
Cancels the selection within the menu shell.
Since: 2.4
void gtk_menu_shell_set_take_focus (GtkMenuShell *menu_shell
,gboolean take_focus
);
If take_focus
is TRUE
(the default) the menu shell will take the keyboard
focus so that it will receive all keyboard events which is needed to enable
keyboard navigation in menus.
Setting take_focus
to FALSE
is useful only for special applications
like virtual keyboard implementations which should not take keyboard
focus.
The take_focus
state of a menu or menu bar is automatically propagated
to submenus whenever a submenu is popped up, so you don't have to worry
about recursively setting it for your entire menu hierarchy. Only when
programmatically picking a submenu and popping it up manually, the
take_focus
property of the submenu needs to be set explicitely.
Note that setting it to FALSE
has side-effects:
If the focus is in some other app, it keeps the focus and keynav in the menu doesn't work. Consequently, keynav on the menu will only work if the focus is on some toplevel owned by the onscreen keyboard.
To avoid confusing the user, menus with take_focus
set to FALSE
should not display mnemonics or accelerators, since it cannot be
guaranteed that they will work.
See also gdk_keyboard_grab()
Since: 2.8
gboolean
gtk_menu_shell_get_take_focus (GtkMenuShell *menu_shell
);
Returns TRUE
if the menu shell will take the keyboard focus on popup.
Since: 2.8
“take-focus”
property “take-focus” gboolean
A boolean that determines whether the menu and its submenus grab the
keyboard focus. See gtk_menu_shell_set_take_focus()
and
gtk_menu_shell_get_take_focus()
.
Owner: GtkMenuShell
Flags: Read / Write
Default value: TRUE
Since: 2.8
“activate-current”
signalvoid user_function (GtkMenuShell *menushell, gboolean arg1, gpointer user_data)
Flags: Action
“cycle-focus”
signalvoid user_function (GtkMenuShell *menushell, GtkDirectionType arg1, gpointer user_data)
Flags: Action
“deactivate”
signalvoid user_function (GtkMenuShell *menushell, gpointer user_data)
Flags: Run First
“insert”
signalvoid user_function (GtkMenuShell *menu_shell, GtkWidget *child, int position, gpointer user_data)
The ::insert signal is emitted when a new GtkMenuItem is added to a GtkMenuShell. A separate signal is used instead of GtkContainer::add because of the need for an additional position parameter.
The inverse of this signal is the GtkContainer::remove signal.
menu_shell |
the object on which the signal is emitted |
|
child |
the GtkMenuItem that is being inserted |
|
position |
the position at which the insert occurs |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
Since: 2.24.15
“move-current”
signalvoid user_function (GtkMenuShell *menushell, GtkMenuDirectionType arg1, gpointer user_data)
Flags: Action
“move-selected”
signalgboolean user_function (GtkMenuShell *menu_shell, int distance, gpointer user_data)
The ::move-selected signal is emitted to move the selection to another item.
menu_shell |
the object on which the signal is emitted |
|
distance |
+1 to move to the next item, -1 to move to the previous |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 2.12
“selection-done”
signalvoid user_function (GtkMenuShell *menushell, gpointer user_data)
Flags: Run First