TearoffMenuItem

A gtk.TearoffMenuItem is a special gtk.MenuItem which is used to tear off and reattach its menu.

When its menu is shown normally, the gtk.TearoffMenuItem 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 gtk.TearoffMenuItem 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.

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

Constructors

this
this(GtkTearoffMenuItem* gtkTearoffMenuItem, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this()

Creates a new gtk.TearoffMenuItem

Members

Functions

getStruct
void* getStruct()

the main Gtk struct as a void*

getTearoffMenuItemStruct
GtkTearoffMenuItem* getTearoffMenuItemStruct(bool transferOwnership)

Get the main Gtk struct

Static functions

getType
GType getType()

Variables

gtkTearoffMenuItem
GtkTearoffMenuItem* gtkTearoffMenuItem;

the main Gtk struct

Inherited Members

From MenuItem

gtkMenuItem
GtkMenuItem* gtkMenuItem;

the main Gtk struct

getMenuItemStruct
GtkMenuItem* getMenuItemStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

getActionName
string getActionName()

Gets the application set action code

getType
GType getType()
itemActivate
void itemActivate()

Emits the activate signal on the given item

deselect
void deselect()

Emits the 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
Widget getSubmenu()

Gets the submenu underneath this menu item, if any. See Menu.itemSetSubmenu.

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 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 AccelMap.save on this). To set up a default accelerator for this menu item, call AccelMap.addEntry with the same accel_path. See also AccelMap.addEntry on the specifics of accelerator paths, and 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(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 toggle-size-allocate signal on the given item.

toggleSizeRequest
void toggleSizeRequest(int requisition)

Emits the toggle-size-request signal on the given item.

addOnActivate
gulong addOnActivate(void delegate(MenuItem) dlg, ConnectFlags connectFlags)

Emitted when the item is activated.

addOnActivateItem
gulong addOnActivateItem(void delegate(MenuItem) dlg, ConnectFlags connectFlags)

Emitted when the item is activated, but also if the menu item has a submenu. For normal applications, the relevant signal is activate.

addOnDeselect
gulong addOnDeselect(void delegate(MenuItem) dlg, ConnectFlags connectFlags)
addOnSelect
gulong addOnSelect(void delegate(MenuItem) dlg, ConnectFlags connectFlags)
addOnToggleSizeAllocate
gulong addOnToggleSizeAllocate(void delegate(int, MenuItem) dlg, ConnectFlags connectFlags)
addOnToggleSizeRequest
gulong addOnToggleSizeRequest(void delegate(void*, MenuItem) dlg, ConnectFlags connectFlags)