TearoffMenuItem

A #GtkTearoffMenuItem is a special #GtkMenuItem which is used to tear off and reattach its menu.

When its menu is shown normally, the #GtkTearoffMenuItem is drawn as a dotted line indicating that the menu can be torn off. Activating it causes its menu to be torn off and displayed in its own window as a tearoff menu.

When its menu is shown as a tearoff menu, the #GtkTearoffMenuItem is drawn as a dotted line which has a left pointing arrow graphic indicating that the tearoff menu can be reattached. Activating it will erase the tearoff menu window.

> #GtkTearoffMenuItem is deprecated and should not be used in newly > written code. Menus are not meant to be torn around.

Constructors

this
this(void* ptr, Flag!"Take" take)
this
this()

Creates a new #GtkTearoffMenuItem.

Members

Functions

self
TearoffMenuItem self()

Returns this, for use in with statements.

Properties

_gType
GType _gType [@property getter]

Static functions

_getGType
GType _getGType()
builder
TearoffMenuItemGidBuilder builder()

Get builder for gtk.tearoff_menu_item.TearoffMenuItem

Inherited Members

From MenuItem

_getGType
GType _getGType()
_gType
GType _gType [@property getter]
self
MenuItem self()

Returns this, for use in with statements.

builder
MenuItemGidBuilder builder()

Get builder for gtk.menu_item.MenuItem

accelPath
string accelPath [@property getter]

Get accelPath property.

accelPath
string accelPath [@property setter]

Set accelPath property.

label
string label [@property getter]

Get label property.

label
string label [@property setter]

Set label property.

rightJustified
bool rightJustified [@property getter]

Get rightJustified property.

rightJustified
bool rightJustified [@property setter]

Set rightJustified property.

submenu
gtk.menu.Menu submenu [@property getter]

Get submenu property.

submenu
gtk.menu.Menu submenu [@property setter]

Set submenu property.

useUnderline
bool useUnderline [@property getter]

Get useUnderline property.

useUnderline
bool useUnderline [@property setter]

Set useUnderline property.

newWithLabel
gtk.menu_item.MenuItem newWithLabel(string label)

Creates a new #GtkMenuItem whose child is a #GtkLabel.

newWithMnemonic
gtk.menu_item.MenuItem newWithMnemonic(string label)

Creates a new #GtkMenuItem containing a label.

activate
void activate()

Emits the #GtkMenuItem::activate signal on the given item

deselect
void deselect()

Emits the #GtkMenuItem::deselect signal on the given item.

getAccelPath
string getAccelPath()

Retrieve the accelerator path that was previously set on menu_item.

getLabel
string getLabel()

Sets text on the menu_item label

getReserveIndicator
bool getReserveIndicator()

Returns whether the menu_item reserves space for the submenu indicator, regardless if it has a submenu or not.

getRightJustified
bool getRightJustified()

Gets whether the menu item appears justified at the right side of the menu bar.

getSubmenu
gtk.widget.Widget getSubmenu()

Gets the submenu underneath this menu item, if any. See gtk.menu_item.MenuItem.setSubmenu.

getUseUnderline
bool getUseUnderline()

Checks if an underline in the text indicates the next character should be used for the mnemonic accelerator key.

select
void select()

Emits the #GtkMenuItem::select signal on the given item.

setAccelPath
void setAccelPath(string accelPath)

Set the accelerator path on menu_item, through which runtime changes of the menu item’s accelerator caused by the user can be identified and saved to persistent storage (see gtk.accel_map.AccelMap.save on this). To set up a default accelerator for this menu item, call gtk.accel_map.AccelMap.addEntry with the same accel_path. See also gtk.accel_map.AccelMap.addEntry on the specifics of accelerator paths, and gtk.menu.Menu.setAccelPath for a more convenient variant of this function.

setLabel
void setLabel(string label)

Sets text on the menu_item label

setReserveIndicator
void setReserveIndicator(bool reserve)

Sets whether the menu_item should reserve space for the submenu indicator, regardless if it actually has a submenu or not.

setRightJustified
void setRightJustified(bool rightJustified)

Sets whether the menu item appears justified at the right side of a menu bar. This was traditionally done for “Help” menu items, but is now considered a bad idea. (If the widget layout is reversed for a right-to-left language like Hebrew or Arabic, right-justified-menu-items appear at the left.)

setSubmenu
void setSubmenu(gtk.menu.Menu submenu)

Sets or replaces the menu item’s submenu, or removes it when a null submenu is passed.

setUseUnderline
void setUseUnderline(bool setting)

If true, an underline in the text indicates the next character should be used for the mnemonic accelerator key.

toggleSizeAllocate
void toggleSizeAllocate(int allocation)

Emits the #GtkMenuItem::toggle-size-allocate signal on the given item.

toggleSizeRequest
void toggleSizeRequest(int requisition)

Emits the #GtkMenuItem::toggle-size-request signal on the given item.

connectActivate
gulong connectActivate(T callback, Flag!"After" after)

Connect to Activate signal.

connectActivateItem
gulong connectActivateItem(T callback, Flag!"After" after)

Connect to ActivateItem signal.

connectDeselect
gulong connectDeselect(T callback, Flag!"After" after)

Connect to Deselect signal.

connectSelect
gulong connectSelect(T callback, Flag!"After" after)

Connect to Select signal.

connectToggleSizeAllocate
gulong connectToggleSizeAllocate(T callback, Flag!"After" after)

Connect to ToggleSizeAllocate signal.

connectToggleSizeRequest
gulong connectToggleSizeRequest(T callback, Flag!"After" after)

Connect to ToggleSizeRequest signal.