Glib.Menu

Entities

Tagged Types

Access Types

Subprograms

Description

Glib.Menu.Gmenu is a simple implementation of Glib.Menu_Model.Gmenu_Model. You populate a Glib.Menu.Gmenu by adding Glib.Menu.Gmenu_Item instances to it.

There are some convenience functions to allow you to directly add items (avoiding Glib.Menu.Gmenu_Item) for the common cases. To add a regular item, use Glib.Menu.Insert. To add a section, use Glib.Menu.Insert_Section. To add a submenu, use Glib.Menu.Insert_Submenu.

Append

procedure Append
   (Self            : not null access Gmenu_Record;
    Label           : UTF8_String := "";
    Detailed_Action : UTF8_String := "")

Convenience function for appending a normal menu item to the end of Menu. Combine Glib.Menu.G_New and Glib.Menu.Insert_Item for a more flexible alternative. Since: gtk+ 2.32

Parameters
Self
Label

the section label, or null

Detailed_Action

the detailed action string, or null

Append_Item

procedure Append_Item
   (Self : not null access Gmenu_Record;
    Item : not null access Gmenu_Item_Record'Class)

Appends Item to the end of Menu. See Glib.Menu.Insert_Item for more information. Since: gtk+ 2.32

Parameters
Self
Item

a Glib.Menu.Gmenu_Item to append

Append_Section

procedure Append_Section
   (Self    : not null access Gmenu_Record;
    Label   : UTF8_String := "";
    Section : not null access Glib.Menu_Model.Gmenu_Model_Record'Class)

Convenience function for appending a section menu item to the end of Menu. Combine Glib.Menu.G_New_Section and Glib.Menu.Insert_Item for a more flexible alternative. Since: gtk+ 2.32

Parameters
Self
Label

the section label, or null

Section

a Glib.Menu_Model.Gmenu_Model with the items of the section

Append_Submenu

procedure Append_Submenu
   (Self    : not null access Gmenu_Record;
    Label   : UTF8_String := "";
    Submenu : not null access Glib.Menu_Model.Gmenu_Model_Record'Class)

Convenience function for appending a submenu menu item to the end of Menu. Combine Glib.Menu.G_New_Submenu and Glib.Menu.Insert_Item for a more flexible alternative. Since: gtk+ 2.32

Parameters
Self
Label

the section label, or null

Submenu

a Glib.Menu_Model.Gmenu_Model with the items of the submenu

Freeze

procedure Freeze (Self : not null access Gmenu_Record)

Marks Menu as frozen. After the menu is frozen, it is an error to attempt to make any changes to it. In effect this means that the Glib.Menu.Gmenu API must no longer be used. This function causes Glib.Menu_Model.Is_Mutable to begin returning False, which has some positive performance implications. Since: gtk+ 2.32

Parameters
Self

G_New

procedure G_New (Self : out Gmenu)

Creates a new Glib.Menu.Gmenu. The new menu has no items. Since: gtk+ 2.32

Parameters
Self

G_New

procedure G_New
   (Self            : out Gmenu_Item;
    Label           : UTF8_String := "";
    Detailed_Action : UTF8_String := "")

Creates a new Glib.Menu.Gmenu_Item. If Label is non-null it is used to set the "label" attribute of the new item. If Detailed_Action is non-null it is used to set the "action" and possibly the "target" attribute of the new item. See Glib.Menu.Set_Detailed_Action for more information. Since: gtk+ 2.32

Parameters
Self
Label

the section label, or null

Detailed_Action

the detailed action string, or null

G_New_From_Model

procedure G_New_From_Model
   (Self       : out Gmenu_Item;
    Model      : not null access Glib.Menu_Model.Gmenu_Model_Record'Class;
    Item_Index : Glib.Gint)

Creates a Glib.Menu.Gmenu_Item as an exact copy of an existing menu item in a Glib.Menu_Model.Gmenu_Model. Item_Index must be valid (ie: be sure to call Glib.Menu_Model.Get_N_Items first). Since: gtk+ 2.34

Parameters
Self
Model

a Glib.Menu_Model.Gmenu_Model

Item_Index

the index of an item in Model

G_New_Section

procedure G_New_Section
   (Self    : out Gmenu_Item;
    Label   : UTF8_String := "";
    Section : not null access Glib.Menu_Model.Gmenu_Model_Record'Class)

Creates a new Glib.Menu.Gmenu_Item representing a section. This is a convenience API around Glib.Menu.G_New and Glib.Menu.Set_Section. The effect of having one menu appear as a section of another is exactly as it sounds: the items from Section become a direct part of the menu that Menu_Item is added to. Visual separation is typically displayed between two non-empty sections. If Label is non-null then it will be encorporated into this visual indication. This allows for labeled subsections of a menu. As a simple example, consider a typical "Edit" menu from a simple program. It probably contains an "Undo" and "Redo" item, followed by a separator, followed by "Cut", "Copy" and "Paste". This would be accomplished by creating three Glib.Menu.Gmenu instances. The first would be populated with the "Undo" and "Redo" items, and the second with the "Cut", "Copy" and "Paste" items. The first and second menus would then be added as submenus of the third. In XML format, this would look something like the following:

<menu id='edit-menu'>
  <section>
    <item label='Undo'/>
    <item label='Redo'/>
  </section>
  <section>
    <item label='Cut'/>
    <item label='Copy'/>
    <item label='Paste'/>
  </section>
</menu>

The following example is exactly equivalent. It is more illustrative of the exact relationship between the menus and items (keeping in mind that the 'link' element defines a new menu that is linked to the containing one). The style of the second example is more verbose and difficult to read (and therefore not recommended except for the purpose of understanding what is really going on).

<menu id='edit-menu'>
  <item>
    <link name='section'>
      <item label='Undo'/>
      <item label='Redo'/>
    </link>
  </item>
  <item>
    <link name='section'>
      <item label='Cut'/>
      <item label='Copy'/>
      <item label='Paste'/>
    </link>
  </item>
</menu>

Since: gtk+ 2.32

Parameters
Self
Label

the section label, or null

Section

a Glib.Menu_Model.Gmenu_Model with the items of the section

G_New_Submenu

procedure G_New_Submenu
   (Self    : out Gmenu_Item;
    Label   : UTF8_String := "";
    Submenu : not null access Glib.Menu_Model.Gmenu_Model_Record'Class)

Creates a new Glib.Menu.Gmenu_Item representing a submenu. This is a convenience API around Glib.Menu.G_New and Glib.Menu.Set_Submenu. Since: gtk+ 2.32

Parameters
Self
Label

the section label, or null

Submenu

a Glib.Menu_Model.Gmenu_Model with the items of the submenu

Get_Attribute_Value

function Get_Attribute_Value
   (Self          : not null access Gmenu_Item_Record;
    Attribute     : UTF8_String;
    Expected_Type : Glib.Variant.Gvariant_Type)
    return Glib.Variant.Gvariant

Queries the named Attribute on Menu_Item. If Expected_Type is specified and the attribute does not have this type, null is returned. null is also returned if the attribute simply does not exist. Since: gtk+ 2.34

Parameters
Self
Attribute

the attribute name to query

Expected_Type

the expected type of the attribute

Return Value

the attribute value, or null

Get_Link

function Get_Link
   (Self : not null access Gmenu_Item_Record;
    Link : UTF8_String) return Glib.Menu_Model.Gmenu_Model

Queries the named Link on Menu_Item. Since: gtk+ 2.34

Parameters
Self
Link

the link name to query

Return Value

the link, or null

Get_Type_Menu

function Get_Type_Menu return Glib.GType
Return Value

Get_Type_Menu_Item

function Get_Type_Menu_Item return Glib.GType
Return Value

Gmenu

type Gmenu is access all Gmenu_Record'Class;

Gmenu_Item

type Gmenu_Item is access all Gmenu_Item_Record'Class;

Gmenu_Item_New

function Gmenu_Item_New
   (Label           : UTF8_String := "";
    Detailed_Action : UTF8_String := "") return Gmenu_Item

Creates a new Glib.Menu.Gmenu_Item. If Label is non-null it is used to set the "label" attribute of the new item. If Detailed_Action is non-null it is used to set the "action" and possibly the "target" attribute of the new item. See Glib.Menu.Set_Detailed_Action for more information. Since: gtk+ 2.32

Parameters
Label

the section label, or null

Detailed_Action

the detailed action string, or null

Return Value

Gmenu_Item_New_From_Model

function Gmenu_Item_New_From_Model
   (Model      : not null access Glib.Menu_Model.Gmenu_Model_Record'Class;
    Item_Index : Glib.Gint) return Gmenu_Item

Creates a Glib.Menu.Gmenu_Item as an exact copy of an existing menu item in a Glib.Menu_Model.Gmenu_Model. Item_Index must be valid (ie: be sure to call Glib.Menu_Model.Get_N_Items first). Since: gtk+ 2.34

Parameters
Model

a Glib.Menu_Model.Gmenu_Model

Item_Index

the index of an item in Model

Return Value

Gmenu_Item_New_Section

function Gmenu_Item_New_Section
   (Label   : UTF8_String := "";
    Section : not null access Glib.Menu_Model.Gmenu_Model_Record'Class)
    return Gmenu_Item

Creates a new Glib.Menu.Gmenu_Item representing a section. This is a convenience API around Glib.Menu.G_New and Glib.Menu.Set_Section. The effect of having one menu appear as a section of another is exactly as it sounds: the items from Section become a direct part of the menu that Menu_Item is added to. Visual separation is typically displayed between two non-empty sections. If Label is non-null then it will be encorporated into this visual indication. This allows for labeled subsections of a menu. As a simple example, consider a typical "Edit" menu from a simple program. It probably contains an "Undo" and "Redo" item, followed by a separator, followed by "Cut", "Copy" and "Paste". This would be accomplished by creating three Glib.Menu.Gmenu instances. The first would be populated with the "Undo" and "Redo" items, and the second with the "Cut", "Copy" and "Paste" items. The first and second menus would then be added as submenus of the third. In XML format, this would look something like the following:

<menu id='edit-menu'>
  <section>
    <item label='Undo'/>
    <item label='Redo'/>
  </section>
  <section>
    <item label='Cut'/>
    <item label='Copy'/>
    <item label='Paste'/>
  </section>
</menu>

The following example is exactly equivalent. It is more illustrative of the exact relationship between the menus and items (keeping in mind that the 'link' element defines a new menu that is linked to the containing one). The style of the second example is more verbose and difficult to read (and therefore not recommended except for the purpose of understanding what is really going on).

<menu id='edit-menu'>
  <item>
    <link name='section'>
      <item label='Undo'/>
      <item label='Redo'/>
    </link>
  </item>
  <item>
    <link name='section'>
      <item label='Cut'/>
      <item label='Copy'/>
      <item label='Paste'/>
    </link>
  </item>
</menu>

Since: gtk+ 2.32

Parameters
Label

the section label, or null

Section

a Glib.Menu_Model.Gmenu_Model with the items of the section

Return Value

Gmenu_Item_New_Submenu

function Gmenu_Item_New_Submenu
   (Label   : UTF8_String := "";
    Submenu : not null access Glib.Menu_Model.Gmenu_Model_Record'Class)
    return Gmenu_Item

Creates a new Glib.Menu.Gmenu_Item representing a submenu. This is a convenience API around Glib.Menu.G_New and Glib.Menu.Set_Submenu. Since: gtk+ 2.32

Parameters
Label

the section label, or null

Submenu

a Glib.Menu_Model.Gmenu_Model with the items of the submenu

Return Value

Gmenu_Item_Record

type Gmenu_Item_Record is new GObject_Record with null record;

Gmenu_New

function Gmenu_New return Gmenu

Creates a new Glib.Menu.Gmenu. The new menu has no items. Since: gtk+ 2.32

Return Value

Gmenu_Record

type Gmenu_Record is new Gmenu_Model_Record with null record;

Initialize

procedure Initialize
   (Self            : not null access Gmenu_Item_Record'Class;
    Label           : UTF8_String := "";
    Detailed_Action : UTF8_String := "")

Creates a new Glib.Menu.Gmenu_Item. If Label is non-null it is used to set the "label" attribute of the new item. If Detailed_Action is non-null it is used to set the "action" and possibly the "target" attribute of the new item. See Glib.Menu.Set_Detailed_Action for more information. Since: gtk+ 2.32 Initialize does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Self
Label

the section label, or null

Detailed_Action

the detailed action string, or null

Initialize

procedure Initialize (Self : not null access Gmenu_Record'Class)

Creates a new Glib.Menu.Gmenu. The new menu has no items. Since: gtk+ 2.32 Initialize does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Self

Initialize_From_Model

procedure Initialize_From_Model
   (Self       : not null access Gmenu_Item_Record'Class;
    Model      : not null access Glib.Menu_Model.Gmenu_Model_Record'Class;
    Item_Index : Glib.Gint)

Creates a Glib.Menu.Gmenu_Item as an exact copy of an existing menu item in a Glib.Menu_Model.Gmenu_Model. Item_Index must be valid (ie: be sure to call Glib.Menu_Model.Get_N_Items first). Since: gtk+ 2.34 Initialize_From_Model does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Self
Model

a Glib.Menu_Model.Gmenu_Model

Item_Index

the index of an item in Model

Initialize_Section

procedure Initialize_Section
   (Self    : not null access Gmenu_Item_Record'Class;
    Label   : UTF8_String := "";
    Section : not null access Glib.Menu_Model.Gmenu_Model_Record'Class)

Creates a new Glib.Menu.Gmenu_Item representing a section. This is a convenience API around Glib.Menu.G_New and Glib.Menu.Set_Section. The effect of having one menu appear as a section of another is exactly as it sounds: the items from Section become a direct part of the menu that Menu_Item is added to. Visual separation is typically displayed between two non-empty sections. If Label is non-null then it will be encorporated into this visual indication. This allows for labeled subsections of a menu. As a simple example, consider a typical "Edit" menu from a simple program. It probably contains an "Undo" and "Redo" item, followed by a separator, followed by "Cut", "Copy" and "Paste". This would be accomplished by creating three Glib.Menu.Gmenu instances. The first would be populated with the "Undo" and "Redo" items, and the second with the "Cut", "Copy" and "Paste" items. The first and second menus would then be added as submenus of the third. In XML format, this would look something like the following:

<menu id='edit-menu'>
  <section>
    <item label='Undo'/>
    <item label='Redo'/>
  </section>
  <section>
    <item label='Cut'/>
    <item label='Copy'/>
    <item label='Paste'/>
  </section>
</menu>

The following example is exactly equivalent. It is more illustrative of the exact relationship between the menus and items (keeping in mind that the 'link' element defines a new menu that is linked to the containing one). The style of the second example is more verbose and difficult to read (and therefore not recommended except for the purpose of understanding what is really going on).

<menu id='edit-menu'>
  <item>
    <link name='section'>
      <item label='Undo'/>
      <item label='Redo'/>
    </link>
  </item>
  <item>
    <link name='section'>
      <item label='Cut'/>
      <item label='Copy'/>
      <item label='Paste'/>
    </link>
  </item>
</menu>

Since: gtk+ 2.32 Initialize_Section does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Self
Label

the section label, or null

Section

a Glib.Menu_Model.Gmenu_Model with the items of the section

Initialize_Submenu

procedure Initialize_Submenu
   (Self    : not null access Gmenu_Item_Record'Class;
    Label   : UTF8_String := "";
    Submenu : not null access Glib.Menu_Model.Gmenu_Model_Record'Class)

Creates a new Glib.Menu.Gmenu_Item representing a submenu. This is a convenience API around Glib.Menu.G_New and Glib.Menu.Set_Submenu. Since: gtk+ 2.32 Initialize_Submenu does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Self
Label

the section label, or null

Submenu

a Glib.Menu_Model.Gmenu_Model with the items of the submenu

Insert

procedure Insert
   (Self            : not null access Gmenu_Record;
    Position        : Glib.Gint;
    Label           : UTF8_String := "";
    Detailed_Action : UTF8_String := "")

Convenience function for inserting a normal menu item into Menu. Combine Glib.Menu.G_New and Glib.Menu.Insert_Item for a more flexible alternative. Since: gtk+ 2.32

Parameters
Self
Position

the position at which to insert the item

Label

the section label, or null

Detailed_Action

the detailed action string, or null

Insert_Item

procedure Insert_Item
   (Self     : not null access Gmenu_Record;
    Position : Glib.Gint;
    Item     : not null access Gmenu_Item_Record'Class)

Inserts Item into Menu. The "insertion" is actually done by copying all of the attribute and link values of Item and using them to form a new item within Menu. As such, Item itself is not really inserted, but rather, a menu item that is exactly the same as the one presently described by Item. This means that Item is essentially useless after the insertion occurs. Any changes you make to it are ignored unless it is inserted again (at which point its updated values will be copied). You should probably just free Item once you're done. There are many convenience functions to take care of common cases. See Glib.Menu.Insert, Glib.Menu.Insert_Section and Glib.Menu.Insert_Submenu as well as "prepend" and "append" variants of each of these functions. Since: gtk+ 2.32

Parameters
Self
Position

the position at which to insert the item

Item

the Glib.Menu.Gmenu_Item to insert

Insert_Section

procedure Insert_Section
   (Self     : not null access Gmenu_Record;
    Position : Glib.Gint;
    Label    : UTF8_String := "";
    Section  : not null access Glib.Menu_Model.Gmenu_Model_Record'Class)

Convenience function for inserting a section menu item into Menu. Combine Glib.Menu.G_New_Section and Glib.Menu.Insert_Item for a more flexible alternative. Since: gtk+ 2.32

Parameters
Self
Position

the position at which to insert the item

Label

the section label, or null

Section

a Glib.Menu_Model.Gmenu_Model with the items of the section

Insert_Submenu

procedure Insert_Submenu
   (Self     : not null access Gmenu_Record;
    Position : Glib.Gint;
    Label    : UTF8_String := "";
    Submenu  : not null access Glib.Menu_Model.Gmenu_Model_Record'Class)

Convenience function for inserting a submenu menu item into Menu. Combine Glib.Menu.G_New_Submenu and Glib.Menu.Insert_Item for a more flexible alternative. Since: gtk+ 2.32

Parameters
Self
Position

the position at which to insert the item

Label

the section label, or null

Submenu

a Glib.Menu_Model.Gmenu_Model with the items of the submenu

Prepend

procedure Prepend
   (Self            : not null access Gmenu_Record;
    Label           : UTF8_String := "";
    Detailed_Action : UTF8_String := "")

Convenience function for prepending a normal menu item to the start of Menu. Combine Glib.Menu.G_New and Glib.Menu.Insert_Item for a more flexible alternative. Since: gtk+ 2.32

Parameters
Self
Label

the section label, or null

Detailed_Action

the detailed action string, or null

Prepend_Item

procedure Prepend_Item
   (Self : not null access Gmenu_Record;
    Item : not null access Gmenu_Item_Record'Class)

Prepends Item to the start of Menu. See Glib.Menu.Insert_Item for more information. Since: gtk+ 2.32

Parameters
Self
Item

a Glib.Menu.Gmenu_Item to prepend

Prepend_Section

procedure Prepend_Section
   (Self    : not null access Gmenu_Record;
    Label   : UTF8_String := "";
    Section : not null access Glib.Menu_Model.Gmenu_Model_Record'Class)

Convenience function for prepending a section menu item to the start of Menu. Combine Glib.Menu.G_New_Section and Glib.Menu.Insert_Item for a more flexible alternative. Since: gtk+ 2.32

Parameters
Self
Label

the section label, or null

Section

a Glib.Menu_Model.Gmenu_Model with the items of the section

Prepend_Submenu

procedure Prepend_Submenu
   (Self    : not null access Gmenu_Record;
    Label   : UTF8_String := "";
    Submenu : not null access Glib.Menu_Model.Gmenu_Model_Record'Class)

Convenience function for prepending a submenu menu item to the start of Menu. Combine Glib.Menu.G_New_Submenu and Glib.Menu.Insert_Item for a more flexible alternative. Since: gtk+ 2.32

Parameters
Self
Label

the section label, or null

Submenu

a Glib.Menu_Model.Gmenu_Model with the items of the submenu

Remove

procedure Remove
   (Self     : not null access Gmenu_Record;
    Position : Glib.Gint)

Removes an item from the menu. Position gives the index of the item to remove. It is an error if position is not in range the range from 0 to one less than the number of items in the menu. It is not possible to remove items by identity since items are added to the menu simply by copying their links and attributes (ie: identity of the item itself is not preserved). Since: gtk+ 2.32

Parameters
Self
Position

the position of the item to remove

Remove_All

procedure Remove_All (Self : not null access Gmenu_Record)

Removes all items in the menu. Since: gtk+ 2.38

Parameters
Self

Set_Action_And_Target_Value

procedure Set_Action_And_Target_Value
   (Self         : not null access Gmenu_Item_Record;
    Action       : UTF8_String := "";
    Target_Value : Glib.Variant.Gvariant)

Sets or unsets the "action" and "target" attributes of Menu_Item. If Action is null then both the "action" and "target" attributes are unset (and Target_Value is ignored). If Action is non-null then the "action" attribute is set. The "target" attribute is then set to the value of Target_Value if it is non-null or unset otherwise. Normal menu items (ie: not submenu, section or other custom item types) are expected to have the "action" attribute set to identify the action that they are associated with. The state type of the action help to determine the disposition of the menu item. See Glib.Action.Gaction and Glib.Action_Group.Gaction_Group for an overview of actions. In general, clicking on the menu item will result in activation of the named action with the "target" attribute given as the parameter to the action invocation. If the "target" attribute is not set then the action is invoked with no parameter. If the action has no state then the menu item is usually drawn as a plain menu item (ie: with no additional decoration). If the action has a boolean state then the menu item is usually drawn as a toggle menu item (ie: with a checkmark or equivalent indication). The item should be marked as 'toggled' or 'checked' when the boolean state is True. If the action has a string state then the menu item is usually drawn as a radio menu item (ie: with a radio bullet or equivalent indication). The item should be marked as 'selected' when the string state is equal to the value of the Target property. See g_menu_item_set_action_and_target or Glib.Menu.Set_Detailed_Action for two equivalent calls that are probably more convenient for most uses. Since: gtk+ 2.32

Parameters
Self
Action

the name of the action for this item

Target_Value

a Glib.Variant.Gvariant to use as the action target

Set_Attribute_Value

procedure Set_Attribute_Value
   (Self      : not null access Gmenu_Item_Record;
    Attribute : UTF8_String;
    Value     : Glib.Variant.Gvariant)

Sets or unsets an attribute on Menu_Item. The attribute to set or unset is specified by Attribute. This can be one of the standard attribute names G_MENU_ATTRIBUTE_LABEL, G_MENU_ATTRIBUTE_ACTION, G_MENU_ATTRIBUTE_TARGET, or a custom attribute name. Attribute names are restricted to lowercase characters, numbers and '-'. Furthermore, the names must begin with a lowercase character, must not end with a '-', and must not contain consecutive dashes. must consist only of lowercase ASCII characters, digits and '-'. If Value is non-null then it is used as the new value for the attribute. If Value is null then the attribute is unset. If the Value Glib.Variant.Gvariant is floating, it is consumed. See also g_menu_item_set_attribute for a more convenient way to do the same. Since: gtk+ 2.32

Parameters
Self
Attribute

the attribute to set

Value

a Glib.Variant.Gvariant to use as the value, or null

Set_Detailed_Action

procedure Set_Detailed_Action
   (Self            : not null access Gmenu_Item_Record;
    Detailed_Action : UTF8_String)

Sets the "action" and possibly the "target" attribute of Menu_Item. The format of Detailed_Action is the same format parsed by g_action_parse_detailed_name. See g_menu_item_set_action_and_target or Glib.Menu.Set_Action_And_Target_Value for more flexible (but slightly less convenient) alternatives. See also Glib.Menu.Set_Action_And_Target_Value for a description of the semantics of the action and target attributes. Since: gtk+ 2.32

Parameters
Self
Detailed_Action

the "detailed" action string

Set_Icon

procedure Set_Icon
   (Self : not null access Gmenu_Item_Record;
    Icon : Glib.G_Icon.G_Icon)

Sets (or unsets) the icon on Menu_Item. This call is the same as calling Glib.G_Icon.Serialize and using the result as the value to Glib.Menu.Set_Attribute_Value for G_MENU_ATTRIBUTE_ICON. This API is only intended for use with "noun" menu items; things like bookmarks or applications in an "Open With" menu. Don't use it on menu items corresponding to verbs (eg: stock icons for 'Save' or 'Quit'). If Icon is null then the icon is unset. Since: gtk+ 2.38

Parameters
Self
Icon

a Glib.G_Icon.G_Icon, or null

Set_Label

procedure Set_Label
   (Self  : not null access Gmenu_Item_Record;
    Label : UTF8_String := "")

Sets or unsets the "label" attribute of Menu_Item. If Label is non-null it is used as the label for the menu item. If it is null then the label attribute is unset. Since: gtk+ 2.32

Parameters
Self
Label

the label to set, or null to unset

Set_Link

procedure Set_Link
   (Self  : not null access Gmenu_Item_Record;
    Link  : UTF8_String;
    Model : access Glib.Menu_Model.Gmenu_Model_Record'Class)

Creates a link from Menu_Item to Model if non-null, or unsets it. Links are used to establish a relationship between a particular menu item and another menu. For example, G_MENU_LINK_SUBMENU is used to associate a submenu with a particular menu item, and G_MENU_LINK_SECTION is used to create a section. Other types of link can be used, but there is no guarantee that clients will be able to make sense of them. Link types are restricted to lowercase characters, numbers and '-'. Furthermore, the names must begin with a lowercase character, must not end with a '-', and must not contain consecutive dashes. Since: gtk+ 2.32

Parameters
Self
Link

type of link to establish or unset

Model

the Glib.Menu_Model.Gmenu_Model to link to (or null to unset)

Set_Section

procedure Set_Section
   (Self    : not null access Gmenu_Item_Record;
    Section : access Glib.Menu_Model.Gmenu_Model_Record'Class)

Sets or unsets the "section" link of Menu_Item to Section. The effect of having one menu appear as a section of another is exactly as it sounds: the items from Section become a direct part of the menu that Menu_Item is added to. See Glib.Menu.G_New_Section for more information about what it means for a menu item to be a section. Since: gtk+ 2.32

Parameters
Self
Section

a Glib.Menu_Model.Gmenu_Model, or null

Set_Submenu

procedure Set_Submenu
   (Self    : not null access Gmenu_Item_Record;
    Submenu : access Glib.Menu_Model.Gmenu_Model_Record'Class)

Sets or unsets the "submenu" link of Menu_Item to Submenu. If Submenu is non-null, it is linked to. If it is null then the link is unset. The effect of having one menu appear as a submenu of another is exactly as it sounds. Since: gtk+ 2.32

Parameters
Self
Submenu

a Glib.Menu_Model.Gmenu_Model, or null