CheckMenuItem

A GtkCheckMenuItem is a menu item that maintains the state of a boolean value in addition to a GtkMenuItem usual role in activating application code.

A check box indicating the state of the boolean value is displayed at the left side of the GtkMenuItem. Activating the GtkMenuItem toggles the value.

Constructors

this
this(GtkCheckMenuItem* gtkCheckMenuItem)

Sets our main struct and passes it to the parent class

this
this(string label, bool mnemonic)

Creates a new GtkCheckMenuItem with a label.

this
this()

Creates a new GtkCheckMenuItem.

Members

Functions

addOnToggled
void addOnToggled(void delegate(CheckMenuItem) dlg, ConnectFlags connectFlags)

This signal is emitted when the state of the check box is changed. A signal handler can use gtk_check_menu_item_get_active() to discover the new state.

getActive
int getActive()

Returns whether the check menu item is active. See gtk_check_menu_item_set_active().

getCheckMenuItemStruct
GtkCheckMenuItem* getCheckMenuItemStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getDrawAsRadio
int getDrawAsRadio()

Returns whether check_menu_item looks like a GtkRadioMenuItem Since 2.4

getInconsistent
int getInconsistent()

Retrieves the value set by gtk_check_menu_item_set_inconsistent().

getStruct
void* getStruct()

the main Gtk struct as a void*

setActive
void setActive(int isActive)

Sets the active state of the menu item's check box.

setDrawAsRadio
void setDrawAsRadio(int drawAsRadio)

Sets whether check_menu_item is drawn like a GtkRadioMenuItem Since 2.4

setInconsistent
void setInconsistent(int setting)

If the user has selected a range of elements (such as some text or spreadsheet cells) that are affected by a boolean setting, and the current values in that range are inconsistent, you may want to display the check in an "in between" state. This function turns on "in between" display. Normally you would turn off the inconsistent state again if the user explicitly selects a setting. This has to be done manually, gtk_check_menu_item_set_inconsistent() only affects visual appearance, it doesn't affect the semantics of the widget.

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
toggled
void toggled()

Emits the "toggled" signal.

Static functions

callBackToggled
void callBackToggled(GtkCheckMenuItem* checkmenuitemStruct, CheckMenuItem _checkMenuItem)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

connectedSignals
int[string] connectedSignals;
gtkCheckMenuItem
GtkCheckMenuItem* gtkCheckMenuItem;

the main Gtk struct

onToggledListeners
void delegate(CheckMenuItem)[] onToggledListeners;
Undocumented in source.

Inherited Members

From MenuItem

gtkMenuItem
GtkMenuItem* gtkMenuItem;

the main Gtk struct

getMenuItemStruct
GtkMenuItem* getMenuItemStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
__anonymous
mixin ActivatableT!(GtkMenuItem)
Undocumented in source.
getActionName
string getActionName()

Gets the application set action code

connectedSignals
int[string] connectedSignals;
onActivateListeners
void delegate(MenuItem)[] onActivateListeners;
Undocumented in source.
addOnActivate
void addOnActivate(void delegate(MenuItem) dlg, ConnectFlags connectFlags)

Emitted when the item is activated.

callBackActivate
void callBackActivate(GtkMenuItem* menuitemStruct, MenuItem _menuItem)
Undocumented in source. Be warned that the author may not have intended to support it.
onActivateItemListeners
void delegate(MenuItem)[] onActivateItemListeners;
Undocumented in source.
addOnActivateItem
void 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".

callBackActivateItem
void callBackActivateItem(GtkMenuItem* menuitemStruct, MenuItem _menuItem)
Undocumented in source. Be warned that the author may not have intended to support it.
onDeselectListeners
void delegate(MenuItem)[] onDeselectListeners;
Undocumented in source.
addOnDeselect
void addOnDeselect(void delegate(MenuItem) dlg, ConnectFlags connectFlags)
callBackDeselect
void callBackDeselect(GtkMenuItem* menuitemStruct, MenuItem _menuItem)
Undocumented in source. Be warned that the author may not have intended to support it.
onSelectListeners
void delegate(MenuItem)[] onSelectListeners;
Undocumented in source.
addOnSelect
void addOnSelect(void delegate(MenuItem) dlg, ConnectFlags connectFlags)
callBackSelect
void callBackSelect(GtkMenuItem* menuitemStruct, MenuItem _menuItem)
Undocumented in source. Be warned that the author may not have intended to support it.
onToggleSizeAllocateListeners
void delegate(gint, MenuItem)[] onToggleSizeAllocateListeners;
Undocumented in source.
addOnToggleSizeAllocate
void addOnToggleSizeAllocate(void delegate(gint, MenuItem) dlg, ConnectFlags connectFlags)
callBackToggleSizeAllocate
void callBackToggleSizeAllocate(GtkMenuItem* menuitemStruct, gint arg1, MenuItem _menuItem)
Undocumented in source. Be warned that the author may not have intended to support it.
onToggleSizeRequestListeners
void delegate(void*, MenuItem)[] onToggleSizeRequestListeners;
Undocumented in source.
addOnToggleSizeRequest
void addOnToggleSizeRequest(void delegate(void*, MenuItem) dlg, ConnectFlags connectFlags)

See Also GtkBin, GtkMenuShell

callBackToggleSizeRequest
void callBackToggleSizeRequest(GtkMenuItem* menuitemStruct, void* arg1, MenuItem _menuItem)
Undocumented in source. Be warned that the author may not have intended to support it.
setRightJustified
void setRightJustified(int rightJustified)

Warning gtk_menu_item_set_right_justified has been deprecated since version 3.2 and should not be used in newly-written code. If you insist on using it, use gtk_widget_set_hexpand() and gtk_widget_set_halign(). 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.)

getRightJustified
int getRightJustified()

Warning gtk_menu_item_get_right_justified has been deprecated since version 3.2 and should not be used in newly-written code. See gtk_menu_item_set_right_justified() Gets whether the menu item appears justified at the right side of the menu bar.

getLabel
string getLabel()

Sets text on the menu_item label Since 2.16

setLabel
void setLabel(string label)

Sets text on the menu_item label Since 2.16

getUseUnderline
int getUseUnderline()

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

setUseUnderline
void setUseUnderline(int setting)

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

setSubmenu
void setSubmenu(Widget submenu)

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

getSubmenu
Widget getSubmenu()

Gets the submenu underneath this menu item, if any. See gtk_menu_item_set_submenu().

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_save() on this). To set up a default accelerator for this menu item, call gtk_accel_map_add_entry() with the same accel_path. See also gtk_accel_map_add_entry() on the specifics of accelerator paths, and gtk_menu_set_accel_path() for a more convenient variant of this function. This function is basically a convenience wrapper that handles calling gtk_widget_set_accel_path() with the appropriate accelerator group for the menu item. Note that you do need to set an accelerator on the parent menu with gtk_menu_set_accel_group() for this to work. Note that accel_path string will be stored in a GQuark. Therefore, if you pass a static string, you can save some memory by interning it first with g_intern_static_string().

getAccelPath
string getAccelPath()

Retrieve the accelerator path that was previously set on menu_item. See gtk_menu_item_set_accel_path() for details. Since 2.14

select
void select()

Emits the "select" signal on the given item. Behaves exactly like gtk_item_select.

deselect
void deselect()

Emits the "deselect" signal on the given item. Behaves exactly like gtk_item_deselect.

itemActivate
void itemActivate()

Emits the "activate" signal on the given item

toggleSizeRequest
void toggleSizeRequest(int requisition)

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

toggleSizeAllocate
void toggleSizeAllocate(int allocation)

Emits the "toggle-size-allocate" signal on the given item.

getReserveIndicator
int getReserveIndicator()

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

setReserveIndicator
void setReserveIndicator(int reserve)

Sets whether the menu_item should reserve space for the submenu indicator, regardless if it actually has a submenu or not. There should be little need for applications to call this functions.

Meta