MenuItem
Object Hierarchy:
Description:
[ CCode ( type_id = "g_menu_item_get_type ()" ) ]
[ Version ( since = "2.32" ) ]
public sealed class MenuItem : Object
[ Version ( since = "2.32" ) ]
public sealed class MenuItem : Object
MenuItem is an opaque structure type.
You must access it using the functions below.
Namespace: GLib
Package: gio-2.0
Content:
Creation methods:
- public MenuItem (string? label, string? detailed_action)
Creates a new MenuItem.
- public MenuItem.from_model (MenuModel model, int item_index)
Creates a MenuItem as an exact copy of an existing menu item in a MenuModel.
- public MenuItem.section (string? label, MenuModel section)
Creates a new MenuItem representing a section.
- public MenuItem.submenu (string? label, MenuModel submenu)
Creates a new MenuItem representing a submenu.
Methods:
- public bool get_attribute (string attribute, string format_string, ...)
Queries the named
attribute
on this . - public Variant? get_attribute_value (string attribute, VariantType? expected_type)
Queries the named
attribute
on this . - public MenuModel? get_link (string link)
Queries the named
link
on this . - public void set_action_and_target (string? action, string? format_string, ...)
Sets or unsets the "action" and "target" attributes of this.
- public void set_action_and_target_value (string? action, Variant? target_value)
Sets or unsets the "action" and "target" attributes of this.
- public void set_attribute (string attribute, string? format_string, ...)
Sets or unsets an attribute on this.
- public void set_attribute_value (string attribute, Variant? value)
Sets or unsets an attribute on this.
- public void set_detailed_action (string detailed_action)
Sets the "action" and possibly the "target" attribute of this.
- public void set_icon (Icon icon)
Sets (or unsets) the icon on this.
- public void set_label (string? label)
Sets or unsets the "label" attribute of this .
- public void set_link (string link, MenuModel? model)
Creates a link from this to
model
if non-null, or unsets it. - public void set_section (MenuModel? section)
Sets or unsets the "section" link of this to
section
. - public void set_submenu (MenuModel? submenu)
Sets or unsets the "submenu" link of this to
submenu
.
Inherited Members:
All known members inherited from class GLib.Object