MenuItem

open class MenuItem(pointer: <Error class: unknown class><<Error class: unknown class>>)

#GMenuItem is an opaque structure type. You must access it using the functions below.

Since

2.32

Constructors

Link copied to clipboard
constructor(label: String? = null, detailedAction: String? = null)

Creates a new #GMenuItem.

constructor(model: MenuModel, itemIndex: Int)

Creates a #GMenuItem as an exact copy of an existing menu item in a #GMenuModel.

constructor(label: String? = null, section: MenuModel)

Creates a new #GMenuItem representing a section.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val gioMenuItemPointer: <Error class: unknown class><<Error class: unknown class>>

Functions

Link copied to clipboard
open fun getAttributeValue(attribute: String, expectedType: <Error class: unknown class>? = null): <Error class: unknown class>?

Queries the named @attribute on @menu_item.

Link copied to clipboard
open fun getLink(link: String): MenuModel?

Queries the named @link on @menu_item.

Link copied to clipboard
open fun setActionAndTargetValue(action: String? = null, targetValue: <Error class: unknown class>? = null)

Sets or unsets the "action" and "target" attributes of @menu_item.

Link copied to clipboard
open fun setAttributeValue(attribute: String, value: <Error class: unknown class>? = null)

Sets or unsets an attribute on @menu_item.

Link copied to clipboard
open fun setDetailedAction(detailedAction: String)

Sets the "action" and possibly the "target" attribute of @menu_item.

Link copied to clipboard
open fun setIcon(icon: Icon)

Sets (or unsets) the icon on @menu_item.

Link copied to clipboard
open fun setLabel(label: String? = null)

Sets or unsets the "label" attribute of @menu_item.

Link copied to clipboard
open fun setLink(link: String, model: MenuModel? = null)

Creates a link from @menu_item to @model if non-null, or unsets it.

Link copied to clipboard
open fun setSection(section: MenuModel? = null)

Sets or unsets the "section" link of @menu_item to @section.

Link copied to clipboard
open fun setSubmenu(submenu: MenuModel? = null)

Sets or unsets the "submenu" link of @menu_item to @submenu.