Menu
Object Hierarchy:
GLib.Menu
GLib.Menu
GLib.Menu
GLib.MenuModel
GLib.MenuModel
GLib.MenuModel->GLib.Menu
GLib.Object
GLib.Object
GLib.Object->GLib.MenuModel
Description:
[
CCode ( type_id =
"g_menu_get_type ()" ) ]
[
Version ( since =
"2.32" ) ]
public class Menu :
MenuModel
Menu is a simple implementation of MenuModel .
You populate a Menu by adding MenuItem instances to it.
There are some convenience functions to allow you to directly add items (avoiding MenuItem
) for the common cases. To add a regular item, use insert . To add a section, use
insert_section . To add a submenu, use
insert_submenu .
Content:
Constants:
public const string ATTRIBUTE_ACTION
The menu item attribute which holds the action name of the item.
public const string ATTRIBUTE_ACTION_NAMESPACE
The menu item attribute that holds the namespace for all action names
in menus that are linked from this item.
public const string ATTRIBUTE_ICON
The menu item attribute which holds the icon of the item.
public const string ATTRIBUTE_LABEL
The menu item attribute which holds the label of the item.
public const string ATTRIBUTE_TARGET
The menu item attribute which holds the target with which the item's
action will be activated.
public const string LINK_SECTION
The name of the link that associates a menu item with a section.
public const string LINK_SUBMENU
The name of the link that associates a menu item with a submenu.
Creation methods:
public Menu ()
Creates a new Menu .
Methods:
public void append (string ? label, string ? detailed_action)
Convenience function for appending a normal menu item to the end of
this .
public void append_item (MenuItem item)
Appends item
to the end of
this .
public void append_section (string ? label, MenuModel section)
Convenience function for appending a section menu item to the end of
this .
public void append_submenu (string ? label, MenuModel submenu)
Convenience function for appending a submenu menu item to the end of
this .
public void freeze ()
Marks this as frozen.
public void insert (int position, string ? label, string ? detailed_action)
Convenience function for inserting a normal menu item into
this .
public void insert_item (int position, MenuItem item)
Inserts item
into this .
public void insert_section (int position, string ? label, MenuModel section)
Convenience function for inserting a section menu item into
this .
public void insert_submenu (int position, string ? label, MenuModel submenu)
Convenience function for inserting a submenu menu item into
this .
public void prepend (string ? label, string ? detailed_action)
Convenience function for prepending a normal menu item to the start of
this .
public void prepend_item (MenuItem item)
Prepends item
to the start of
this .
public void prepend_section (string ? label, MenuModel section)
Convenience function for prepending a section menu item to the start
of this .
public void prepend_submenu (string ? label, MenuModel submenu)
Convenience function for prepending a submenu menu item to the start
of this .
public void remove (int position)
Removes an item from the menu.
public void remove_all ()
Removes all items in the menu.
Inherited Members:
All known members inherited from class GLib.MenuModel
All known members inherited from class GLib.Object
@get
@new
@ref
@set
add_toggle_ref
add_weak_pointer
bind_property
connect
constructed
disconnect
dispose
dup_data
dup_qdata
force_floating
freeze_notify
get_class
get_data
get_property
get_qdata
get_type
getv
interface_find_property
interface_install_property
interface_list_properties
is_floating
new_valist
new_with_properties
newv
notify
notify_property
ref_count
ref_sink
remove_toggle_ref
remove_weak_pointer
replace_data
replace_qdata
set_data
set_data_full
set_property
set_qdata
set_qdata_full
set_valist
setv
steal_data
steal_qdata
thaw_notify
unref
watch_closure
weak_ref
weak_unref