gtk2/docs/reference/gtk/tmpl/gtkmenuitem.sgml

224 lines
4.2 KiB
Plaintext
Raw Normal View History

1999-08-16 18:51:52 +00:00
<!-- ##### SECTION Title ##### -->
GtkMenuItem
<!-- ##### SECTION Short_Description ##### -->
the widget used for item in menus
1999-08-16 18:51:52 +00:00
<!-- ##### SECTION Long_Description ##### -->
<para>
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.
</para>
<para>
As it derives from #GtkBin it can hold any valid child widget, altough
only a few are really useful.
1999-08-16 18:51:52 +00:00
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
<variablelist>
<varlistentry>
<term>#GtkBin</term>
<listitem><para>for how to handle the child.</para></listitem>
</varlistentry>
<varlistentry>
<term>#GtkItem</term>
<listitem><para>is the abstract class for all sorts of items.</para></listitem>
</varlistentry>
<varlistentry>
<term>#GtkMenuShell</term>
<listitem><para>is always the parent of #GtkMenuItem.</para></listitem>
</varlistentry>
</variablelist>
1999-08-16 18:51:52 +00:00
</para>
<!-- ##### STRUCT GtkMenuItem ##### -->
<para>
</para>
<!-- ##### SIGNAL GtkMenuItem::activate ##### -->
<para>
Emitted when the item is activated.
</para>
@menuitem: the object which received the signal.
<!-- ##### SIGNAL GtkMenuItem::activate-item ##### -->
<para>
Emitted when the item is activated, but also if the menu item has a
submenu. For normal applications, the relevant signal is "activate".
</para>
@menuitem: the object which received the signal.
<!-- ##### SIGNAL GtkMenuItem::toggle-size-allocate ##### -->
<para>
</para>
@menuitem: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GtkMenuItem::toggle-size-request ##### -->
<para>
</para>
@menuitem: the object which received the signal.
@arg1:
<!-- ##### ARG GtkMenuItem:arrow-spacing ##### -->
<para>
</para>
<!-- ##### ARG GtkMenuItem:horizontal-padding ##### -->
<para>
</para>
<!-- ##### ARG GtkMenuItem:selected-shadow-type ##### -->
<para>
</para>
<!-- ##### ARG GtkMenuItem:toggle-spacing ##### -->
<para>
</para>
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gtk_menu_item_new ##### -->
<para>
Creates a new #GtkMenuItem.
1999-08-16 18:51:52 +00:00
</para>
@Returns: the newly created #GtkMenuItem
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gtk_menu_item_new_with_label ##### -->
<para>
Creates a new #GtkMenuItem whose child is a #GtkLabel.
1999-08-16 18:51:52 +00:00
</para>
@label: the text for the label
@Returns: the newly created #GtkMenuItem
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gtk_menu_item_new_with_mnemonic ##### -->
<para>
</para>
@label:
@Returns:
<!-- ##### FUNCTION gtk_menu_item_set_right_justified ##### -->
<para>
</para>
@menu_item:
@right_justified:
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gtk_menu_item_set_submenu ##### -->
<para>
Sets the widget submenu, or changes it.
1999-08-16 18:51:52 +00:00
</para>
@menu_item: the menu item widget
@submenu: the submenu
1999-08-16 18:51:52 +00:00
added gtkaccelmap.sgml. other updates. Mon Nov 12 23:06:38 2001 Tim Janik <timj@gtk.org> * added gtkaccelmap.sgml. other updates. Mon Nov 12 23:08:37 2001 Tim Janik <timj@gtk.org> * gtk/maketypes.awk: fix type utils generation on unix. * gtk/gtkaccelmap.[hc]: new files, implementing a global accelerator registry. * gtk/gtkaccelgroup.[hc]: major API/implementation revamp: removed GTK_ACCEL_SIGNAL_VISIBLE, gtk_accel_group_get_default, gtk_accel_group_get_entry, gtk_accel_group_(un)lock_entry, gtk_accel_group_add/remove, gtk_accel_group_handle_add/remove, gtk_accel_group_create_add/remove, gtk_accel_group_entries_from_object. introduced ::accel_changed signal for change notification, and gtk_accel_group_connect/disconnect to connect closures to accel groups. made gtk_accel_group_attach/detach and gtk_accel_group_activate private functions. deprecated gtk_accel_group_ref/unref. * gtk/gtkaccellabel.[hc]: changes to make accellabels pay attention to accel group changed notification and basically operate on closures. removed gtk_accel_label_get_accel_object and gtk_accel_label_set_accel_object. introduced gtk_accel_label_set_accel_closure, and for convenience, gtk_accel_label_set_accel_widget. * gtk/gtkitemfactory.[hc]: removed accelerator propagation code which mostly moved into gtkaccelmap.[hc]. removed gtk_item_factory_parse_rc*, gtk_item_factory_dump_* and gtk_item_factory_print_func. * gtk/gtkmain.c: call _gtk_accel_map_init(). * gtk/gtkmenuitem.[hc]: introduced gtk_menu_item_set_accel_path(), that associates an accelerator path with menu items, through which persistent accelerator settings on menu items are enabled. * gtk/gtkmenu.[hc]: added gtk_menu_set_accel_path() so accelerator paths of menu item can be default constructed to allow installation of accelerators on menu items that don't come with an accelerator binding by default. * gtk/gtksettings.c: fix STRING type rc settings by special casing them appropriately in the parser. * gtk/gtksignal.[hc]: allow a class function offset of 0 for gtk_signal_newv(). * gtk/gtkwidget.[hc]: accelerator API revamp. removed ::accelerator_add/remove signals, gtk_widget_accelerator_signal, gtk_widget_accelerators_locked, gtk_widget_remove_accelerators and gtk_widget_(un)lock_accelerators. accelerators maintained through gtk_widget_add/remove_accelerator() are not runtime changable now, the correct sequence to setup a widget for runtime changable accelerators is now: gtk_accel_map_add_entry(accel_path, key, mods); _gtk_widget_set_accel_path(widget, accel_path, accel_group); * gtk/gtkwindow.[hc]: accelerator changes, proxy and coalesce accel group changes (as well as mnemonic changes) through the new signal ::accels_changed. Sat Nov 10 12:08:56 2001 Tim Janik <timj@gtk.org> * gtk/gtksettings.c (_gtk_settings_parse_convert): properly handle GString->string conversions.
2001-11-13 00:53:47 +00:00
<!-- ##### FUNCTION gtk_menu_item_set_accel_path ##### -->
<para>
</para>
@menu_item:
@accel_path:
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gtk_menu_item_remove_submenu ##### -->
<para>
Removes the widget's submenu.
1999-08-16 18:51:52 +00:00
</para>
@menu_item: the menu item widget
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gtk_menu_item_select ##### -->
<para>
Emits the "select" signal on the given item. Behaves exactly like
#gtk_item_select.
1999-08-16 18:51:52 +00:00
</para>
@menu_item: the menu item
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gtk_menu_item_deselect ##### -->
<para>
Emits the "deselect" signal on the given item. Behaves exactly like
#gtk_item_deselect.
1999-08-16 18:51:52 +00:00
</para>
@menu_item: the menu item
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gtk_menu_item_activate ##### -->
<para>
Emits the "activate" signal on the given item
1999-08-16 18:51:52 +00:00
</para>
@menu_item: the menu item
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gtk_menu_item_toggle_size_request ##### -->
<para>
Emits the "toggle_size_request" signal on the given item.
</para>
@menu_item: the menu item
@requisition: the requisition to use as signal data.
<!-- ##### FUNCTION gtk_menu_item_toggle_size_allocate ##### -->
<para>
Emits the "toggle_size_allocate" signal on the given item.
</para>
@menu_item: the menu item.
@allocation: the allocation to use as signal data.
<!-- ##### MACRO gtk_menu_item_right_justify ##### -->
1999-08-16 18:51:52 +00:00
<para>
Sets the menu item to be right-justified. Only useful for menu bars.
1999-08-16 18:51:52 +00:00
</para>
@menu_item: the menu item
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gtk_menu_item_get_right_justified ##### -->
<para>
</para>
@menu_item:
@Returns:
<!-- ##### FUNCTION gtk_menu_item_get_submenu ##### -->
<para>
</para>
@menu_item:
@Returns: