# Gtk::Switch Class Reference
Widgets

A "light switch"-style toggle. More...

Inheritance diagram for Gtk::Switch:
[legend]

List of all members.

## Public Member Functions

virtual | ~Switch ()
GtkSwitch* | gobj ()
| Provides access to the underlying C GtkObject.
const GtkSwitch* | gobj () const
| Provides access to the underlying C GtkObject.
| Switch ()
void | set_active (bool is_active=true)
| Changes the state of sw to the desired one.
bool | get_active () const
| Gets whether the Gtk::Switch is in its "on" or "off" state.
Glib::PropertyProxy< bool > | property_active ()
| Whether the switch is on or off.
Glib::PropertyProxy_ReadOnly < bool > | property_active () const
| Whether the switch is on or off.

## Related Functions

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

## Detailed Description

A "light switch"-style toggle.

The Switch widget has two states: on or off. The user can control which state should be active by clicking the empty area, or by dragging the handle.

Since gtkmm 3.0:

## Constructor & Destructor Documentation

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

Gtk::Switch::Switch | ( |  | ) |

## Member Function Documentation

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

Gets whether the Gtk::Switch is in its "on" or "off" state.

Since gtkmm 3.0:

Returns:
  `true` if the Gtk::Switch is active, and `false` otherwise.

GtkSwitch* Gtk::Switch::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Activatable.

const GtkSwitch* Gtk::Switch::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Activatable.

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

Whether the switch is on or off.

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::Switch::property_active | ( |  | ) | const

Whether the switch is on or off.

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::Switch::set_active | ( | bool | is_active = `true` | ) |

Changes the state of sw to the desired one.

Since gtkmm 3.0:

Parameters:

  is_active | `true` if sw should be active, and `false` otherwise.

## Friends And Related Function Documentation

Gtk::Switch* wrap | ( | GtkSwitch * | 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/switch.h