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.

Skipped during bindings generation

  • method get_attribute: Varargs parameter is not supported

  • method set_action_and_target: Varargs parameter is not supported

  • method set_attribute: Varargs parameter is not supported

Since

2.32

Constructors

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

Creates a new #GMenuItem.

constructor(model: MenuModel, itemIndex: <Error class: unknown class>)

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.