Main Page Widgets Namespaces Book

# Gtk::Expander Class Reference
[Widgets]

Inheritance diagram for Gtk::Expander:

[legend]
List of all members.

## Detailed Description

A container which can hide its child.

A Expander allows the user to hide or show its child by clicking on an expander triangle similar to the triangles used in a Gtk::TreeView.

## Public Member Functions

virtual | ~Expander ()
GtkExpander* | gobj ()
| Provides access to the underlying C GtkObject.
const GtkExpander* | gobj () const
| Provides access to the underlying C GtkObject.
| Expander ()
| Creates a new Expander.
| Expander (const Glib::ustring& label, bool mnemonic=false)
| Creates a new Expander with a label.
void | set_expanded (bool expanded=true)
| Sets the state of the expander.
bool | get_expanded () const
| Queries a Gtk::Expander and returns its current state.
void | set_spacing (int spacing)
| Sets the spacing field of expander , which is the number of pixels to place between expander and the child.
int | get_spacing () const
| Gets the value set by set_spacing().
void | set_label (const Glib::ustring& label)
| Sets the text of the label of the expander to label .
Glib::ustring | get_label () const
| Fetches the text from the label of the expander, as set by set_label().
void | set_use_underline (bool use_underline=true)
| If true, an underline in the text of the expander label indicates the next character should be used for the mnemonic accelerator key.
bool | get_use_underline () const
| Returns whether an embedded underline in the expander label indicates a mnemonic.
void | set_use_markup (bool use_markup=true)
| Sets whether the text of the label contains markup in Pango's text markup language.
bool | get_use_markup () const
| Returns whether the label's text is interpreted as marked up with the Pango text markup language.
void | set_label_widget (Widget& label_widget)
| Set the label widget for the expander.
Widget* | get_label_widget ()
| Retrieves the label widget for the frame.
const Widget* | get_label_widget () const
| Retrieves the label widget for the frame.
Glib::PropertyProxy<bool> | property_expanded ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< bool > | property_expanded () const
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<Glib::ustring> | property_label ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_label () const
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<bool> | property_use_underline ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< bool > | property_use_underline () const
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<bool> | property_use_markup ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< bool > | property_use_markup () const
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<int> | property_spacing ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< int > | property_spacing () const
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<Widget*> | property_label_widget ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< Widget* > | property_label_widget () const
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.

## Related Functions

(Note that these are not member functions.)
Gtk::Expander* | wrap (GtkExpander* object, bool take_copy=false)

## Constructor & Destructor Documentation

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

Gtk::Expander::Expander | ( |  | ) |

| Creates a new Expander. The Expander has an empty label. Since: 2.4

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

Creates a new Expander with a label.

Creates a new expander using label as the text of the label. Settin mnemonic to true will allow you to precede characters in the label with an underscore which will make them underlined. If you need a literal underscore character in a label, use '__' (two underscores). The first underlined character represents a keyboard accelerator called a mnemonic. Pressing Alt and that key activates the button.

Parameters:

  | label | The string for the label describing the Expander.
  | mnemonic | Wether the label may contain underscores to set up accelerators.

Since: 2.4

## Member Function Documentation

bool Gtk::Expander::get_expanded | ( |  | ) | const

Queries a Gtk::Expander and returns its current state.

Returns `true` if the child widget is revealed.

See set_expanded().

Returns:
  The current state of the expander.

Since: 2.4.

Glib::ustring Gtk::Expander::get_label | ( |  | ) | const

Fetches the text from the label of the expander, as set by set_label().

If the label text has not been set the return value will be `0`. This will be the case if you create an empty button with Gtk::Button::new() to use as a container.

Returns:
  The text of the label widget. This string is owned by the widget and must not be modified or freed.

Since: 2.4.

const Widget* Gtk::Expander::get_label_widget | ( |  | ) | const

Retrieves the label widget for the frame.

See set_label_widget().

Returns:
  The label widget, or `0` if there is none.

Since: 2.4.

Widget* Gtk::Expander::get_label_widget | ( |  | ) |

Retrieves the label widget for the frame.

See set_label_widget().

Returns:
  The label widget, or `0` if there is none.

Since: 2.4.

int Gtk::Expander::get_spacing | ( |  | ) | const

Gets the value set by set_spacing().

Returns:
  Spacing between the expander and child.

Since: 2.4.

bool Gtk::Expander::get_use_markup | ( |  | ) | const

Returns whether the label's text is interpreted as marked up with the Pango text markup language.

See set_use_markup().

Returns:
  `true` if the label's text will be parsed for markup

Since: 2.4.

bool Gtk::Expander::get_use_underline | ( |  | ) | const

Returns whether an embedded underline in the expander label indicates a mnemonic.

See set_use_underline().

Returns:
  `true` if an embedded underline in the expander label indicates the mnemonic accelerator keys.

Since: 2.4.

const GtkExpander* Gtk::Expander::gobj | ( |  | ) | const`[inline]`

| Provides access to the underlying C GtkObject. Reimplemented from Gtk::Bin.

GtkExpander* Gtk::Expander::gobj | ( |  | ) | `[inline]`

| Provides access to the underlying C GtkObject. Reimplemented from Gtk::Bin.

Glib::PropertyProxy_ReadOnly<bool> Gtk::Expander::property_expanded | ( |  | ) | const

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::Expander::property_expanded | ( |  | ) |

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<Glib::ustring> Gtk::Expander::property_label | ( |  | ) | const

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<Glib::ustring> Gtk::Expander::property_label | ( |  | ) |

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<Widget*> Gtk::Expander::property_label_widget | ( |  | ) | const

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<Widget*> Gtk::Expander::property_label_widget | ( |  | ) |

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<int> Gtk::Expander::property_spacing | ( |  | ) | const

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<int> Gtk::Expander::property_spacing | ( |  | ) |

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::Expander::property_use_markup | ( |  | ) | const

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::Expander::property_use_markup | ( |  | ) |

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::Expander::property_use_underline | ( |  | ) | const

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::Expander::property_use_underline | ( |  | ) |

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::Expander::set_expanded | ( | bool | expanded = `true` | ) |

Sets the state of the expander.

Set to `true`, if you want the child widget to be revealed, and `false` if you want the child widget to be hidden.

Since: 2.4

Parameters:

  | expanded | Whether the child widget is revealed.

void Gtk::Expander::set_label | ( | const Glib::ustring& | label | ) |

Sets the text of the label of the expander to label .

This will also clear any previously set labels.

Since: 2.4

Parameters:

  | label | A string.

void Gtk::Expander::set_label_widget | ( | Widget& | label_widget | ) |

Set the label widget for the expander.

This is the widget that will appear embedded alongside the expander arrow.

Since: 2.4

Parameters:

  | label_widget | The new label widget.

void Gtk::Expander::set_spacing | ( | int | spacing | ) |

Sets the spacing field of expander , which is the number of pixels to place between expander and the child.

Since: 2.4

Parameters:

  | spacing | Distance between the expander and child in pixels.

void Gtk::Expander::set_use_markup | ( | bool | use_markup = `true` | ) |

Sets whether the text of the label contains markup in Pango's text markup language.

See Gtk::Label::set_markup().

Since: 2.4

Parameters:

  | use_markup | `true` if the label's text should be parsed for markup.

void Gtk::Expander::set_use_underline | ( | bool | use_underline = `true` | ) |

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

Since: 2.4

Parameters:

  | use_underline | `true` if underlines in the text indicate mnemonics.

## Friends And Related Function Documentation

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

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:

- expander.h