gtkmm: Gtk::CheckMenuItem Class Reference

# Gtk::CheckMenuItem Class Reference
[Widgets, Menu classes]

A menu item that maintains the state of a boolean value in addition to a Gtk::MenuItem's usual role in activating application code. More...

Inherits Gtk::MenuItem.

Inherited by Gtk::RadioMenuItem.

Collaboration diagram for Gtk::CheckMenuItem:
[legend]

List of all members.

## Public Member Functions

virtual | ~CheckMenuItem ()
GtkCheckMenuItem* | gobj ()
| Provides access to the underlying C GtkObject.
const GtkCheckMenuItem* | gobj () const
| Provides access to the underlying C GtkObject.
| CheckMenuItem ()
| CheckMenuItem (const Glib::ustring& label, bool mnemonic=false)
void | set_active (bool state=true)
bool | get_active () const
| Returns whether the check menu item is active.
void | toggled ()
void | set_inconsistent (bool setting=true)
| 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.
bool | get_inconsistent () const
| Retrieves the value set by set_inconsistent().
void | set_draw_as_radio (bool draw_as_radio=true)
| Sets whether check_menu_item is drawn like a Gtk::RadioMenuItem.
bool | get_draw_as_radio () const
| Returns whether check_menu_item looks like a Gtk::RadioMenuItem.
Glib::SignalProxy0< void > | signal_toggled ()
| Triggered when the item changes state (Note : changing the item's state with set_active() will also trigger this signal).
Glib::PropertyProxy< bool > | property_active ()
| Whether the menu item is checked.
Glib::PropertyProxy_ReadOnly < bool > | property_active () const
| Whether the menu item is checked.
Glib::PropertyProxy< bool > | property_inconsistent ()
| Whether to display an 'inconsistent' state.
Glib::PropertyProxy_ReadOnly < bool > | property_inconsistent () const
| Whether to display an 'inconsistent' state.
Glib::PropertyProxy< bool > | property_draw_as_radio ()
| Whether the menu item looks like a radio menu item.
Glib::PropertyProxy_ReadOnly < bool > | property_draw_as_radio () const
| Whether the menu item looks like a radio menu item.

## Protected Member Functions

virtual void | on_toggled ()
virtual void | draw_indicator_vfunc (GdkRectangle* area)
| Triggered when the item is redrawn (e.g.after being toggled) Overload this signal if you want to implement your own check item look.

## Related Functions

(Note that these are not member functions.)
Gtk::CheckMenuItem* | wrap (GtkCheckMenuItem* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

A menu item that maintains the state of a boolean value in addition to a Gtk::MenuItem's usual role in activating application code.

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

## Constructor & Destructor Documentation

virtual Gtk::CheckMenuItem::~CheckMenuItem | ( |  | ) | `[virtual]`

Gtk::CheckMenuItem::CheckMenuItem | ( |  | ) |

Gtk::CheckMenuItem::CheckMenuItem | ( | const Glib::ustring & | label,
|  | bool | mnemonic = `false` |
| ) |  |  | `[explicit]`

## Member Function Documentation

virtual void Gtk::CheckMenuItem::draw_indicator_vfunc | ( | GdkRectangle * | area | ) | `[protected, virtual]`

Triggered when the item is redrawn (e.g.after being toggled) Overload this signal if you want to implement your own check item look.

Otherwise, you most likely don't care about it. The GdkRectangle specifies the area of the widget which will get redrawn.

bool Gtk::CheckMenuItem::get_active | ( |  | ) | const

Returns whether the check menu item is active.

See set_active().

Returns:
  `true` if the menu item is checked.

bool Gtk::CheckMenuItem::get_draw_as_radio | ( |  | ) | const

Returns whether check_menu_item looks like a Gtk::RadioMenuItem.

Since gtkmm 2.4:

Returns:
  Whether check_menu_item looks like a Gtk::RadioMenuItem.

bool Gtk::CheckMenuItem::get_inconsistent | ( |  | ) | const

Retrieves the value set by set_inconsistent().

Returns:
  `true` if inconsistent.

const GtkCheckMenuItem* Gtk::CheckMenuItem::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::MenuItem.

Reimplemented in Gtk::RadioMenuItem.

GtkCheckMenuItem* Gtk::CheckMenuItem::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::MenuItem.

Reimplemented in Gtk::RadioMenuItem.

virtual void Gtk::CheckMenuItem::on_toggled | ( |  | ) | `[protected, virtual]`

Glib::PropertyProxy_ReadOnly<bool> Gtk::CheckMenuItem::property_active | ( |  | ) | const

Whether the menu item is checked.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<bool> Gtk::CheckMenuItem::property_active | ( |  | ) |

Whether the menu item is checked.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<bool> Gtk::CheckMenuItem::property_draw_as_radio | ( |  | ) | const

Whether the menu item looks like a radio menu item.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<bool> Gtk::CheckMenuItem::property_draw_as_radio | ( |  | ) |

Whether the menu item looks like a radio menu item.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<bool> Gtk::CheckMenuItem::property_inconsistent | ( |  | ) | const

Whether to display an 'inconsistent' state.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<bool> Gtk::CheckMenuItem::property_inconsistent | ( |  | ) |

Whether to display an 'inconsistent' state.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

void Gtk::CheckMenuItem::set_active | ( | bool | state = `true` | ) |

void Gtk::CheckMenuItem::set_draw_as_radio | ( | bool | draw_as_radio = `true` | ) |

Sets whether check_menu_item is drawn like a Gtk::RadioMenuItem.

Since gtkmm 2.4:

Parameters:

  | draw_as_radio | Whether check_menu_item is drawn like a Gtk::RadioMenuItem.

void Gtk::CheckMenuItem::set_inconsistent | ( | bool | setting = `true` | ) |

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, set_inconsistent() only affects visual appearance, it doesn't affect the semantics of the widget.

Parameters:

  | setting | `true` to display an "inconsistent" third state check.

Glib::SignalProxy0< void > Gtk::CheckMenuItem::signal_toggled | ( |  | ) |

Triggered when the item changes state (Note : changing the item's state with set_active() will also trigger this signal).

Prototype:
  `void on_my_toggled()`

void Gtk::CheckMenuItem::toggled | ( |  | ) |

## Friends And Related Function Documentation

Gtk::CheckMenuItem* wrap | ( | GtkCheckMenuItem * | object,
|  | bool | take_copy = `false` |
| ) |  |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  | object | The C instance.
  | take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- gtkmm/checkmenuitem.h