# Gtk::Frame Class Reference
Widgets | Container Widgets

A Gtk::Bin with a decorative frame and optional label. More...

Inheritance diagram for Gtk::Frame:
[legend]
Collaboration diagram for Gtk::Frame:
[legend]

List of all members.

## Public Member Functions

virtual | ~Frame ()
GtkFrame* | gobj ()
| Provides access to the underlying C GtkObject.
const GtkFrame* | gobj () const
| Provides access to the underlying C GtkObject.
| Frame ()
| Frame (const Glib::ustring& label)
void | set_label (const Glib::ustring& label)
| Set the label to appear in the top edge of the frame.
void | unset_label ()
Glib::ustring | get_label () const
| If the frame's label widget is a Gtk::Label, returns the text in the label widget.
void | set_label_widget (Widget& label_widget)
| Sets the label widget for the frame.
Widget* | get_label_widget ()
| Retrieves the label widget for the frame.
const Widget* | get_label_widget () const
| Retrieves the label widget for the frame.
void | set_label_align (float xalign=0.0, float yalign=0.5)
| Set the alignment of the Frame's label.
void | set_label_align (AlignmentEnum xalign, AlignmentEnum yalign=Gtk::ALIGN_CENTER)
| Sets the alignment of the frame widget's label.
void | get_label_align (float& xalign, float& yalign) const
| Retrieves the X and Y alignment of the frame's label.
void | set_shadow_type (ShadowType type)
| Sets shadow type of the frame.
ShadowType | get_shadow_type () const
| Retrieves the shadow type of the frame.
Glib::PropertyProxy < Glib::ustring > | property_label ()
| Text of the frame's label.
Glib::PropertyProxy_ReadOnly < Glib::ustring > | property_label () const
| Text of the frame's label.
Glib::PropertyProxy< double > | property_label_xalign ()
| The horizontal alignment of the label.
Glib::PropertyProxy_ReadOnly < double > | property_label_xalign () const
| The horizontal alignment of the label.
Glib::PropertyProxy< double > | property_label_yalign ()
| The vertical alignment of the label.
Glib::PropertyProxy_ReadOnly < double > | property_label_yalign () const
| The vertical alignment of the label.
Glib::PropertyProxy< ShadowType > | property_shadow_type ()
| Appearance of the frame border.
Glib::PropertyProxy_ReadOnly < ShadowType > | property_shadow_type () const
| Appearance of the frame border.
Glib::PropertyProxy< Widget* > | property_label_widget ()
| A widget to display in place of the usual frame label.
Glib::PropertyProxy_ReadOnly < Widget* > | property_label_widget () const
| A widget to display in place of the usual frame label.

## Protected Member Functions

virtual void | compute_child_allocation_vfunc (Allocation& allocation)

## Related Functions

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

## Detailed Description

A Gtk::Bin with a decorative frame and optional label.

The Frame widget surrounds its single child with a decorative frame and an optional label. If present, the label is drawn in a gap in the top side of the frame. The position of the label can be controlled with set_label_align().

A Frame widget looks like this:

## Constructor & Destructor Documentation

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

Gtk::Frame::Frame | ( |  | ) |

Gtk::Frame::Frame | ( | const Glib::ustring & | label | ) | `[explicit]`

## Member Function Documentation

virtual void Gtk::Frame::compute_child_allocation_vfunc | ( | Allocation& | allocation | ) | `[protected, virtual]`

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

If the frame's label widget is a Gtk::Label, returns the text in the label widget.

(The frame will have a Gtk::Label for the label widget if a non-`0` argument was passed to new().)

Returns:
  The text in the label, or `0` if there was no label widget or the lable widget was not a Gtk::Label. This string is owned by GTK+ and must not be modified or freed.

void Gtk::Frame::get_label_align | ( | float & | xalign,
|  | float & | yalign
| ) |  | const

Retrieves the X and Y alignment of the frame's label.

See set_label_align().

Parameters:

  xalign | Location to store X alignment of frame's label, or `0`.
  yalign | Location to store X alignment of frame's label, or `0`.

const Widget* Gtk::Frame::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.

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

Retrieves the label widget for the frame.

See set_label_widget().

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

ShadowType Gtk::Frame::get_shadow_type | ( |  | ) | const

Retrieves the shadow type of the frame.

See set_shadow_type().

Returns:
  The current shadow type of the frame.

GtkFrame* Gtk::Frame::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Bin.

Reimplemented in Gtk::AspectFrame.

const GtkFrame* Gtk::Frame::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Bin.

Reimplemented in Gtk::AspectFrame.

Glib::PropertyProxy<Glib::ustring> Gtk::Frame::property_label | ( |  | ) |

Text of the frame's 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<Glib::ustring> Gtk::Frame::property_label | ( |  | ) | const

Text of the frame's 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<Widget*> Gtk::Frame::property_label_widget | ( |  | ) |

A widget to display in place of the usual frame 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::Frame::property_label_widget | ( |  | ) | const

A widget to display in place of the usual frame 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<double> Gtk::Frame::property_label_xalign | ( |  | ) |

The horizontal alignment of the 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<double> Gtk::Frame::property_label_xalign | ( |  | ) | const

The horizontal alignment of the 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<double> Gtk::Frame::property_label_yalign | ( |  | ) |

The vertical alignment of the 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<double> Gtk::Frame::property_label_yalign | ( |  | ) | const

The vertical alignment of the 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<ShadowType> Gtk::Frame::property_shadow_type | ( |  | ) |

Appearance of the frame border.

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<ShadowType> Gtk::Frame::property_shadow_type | ( |  | ) | const

Appearance of the frame border.

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::Frame::set_label | ( | const Glib::ustring & | label | ) |

Set the label to appear in the top edge of the frame.

Label alignment defaults to the upper left corner of the frame.

void Gtk::Frame::set_label_align | ( | float | xalign = `0.0`,
|  | float | yalign = `0.5`
| ) |  |

Set the alignment of the Frame's label.

Parameters:

  xalign | The position of the label along the top edge of the widget. A value of 0.0 represents left alignment; 1.0 represents right alignment. The default value for a newly created Frame is 0.0.
  yalign | The y alignment of the label. Currently ignored.

void Gtk::Frame::set_label_align | ( | AlignmentEnum | xalign,
|  | AlignmentEnum | yalign = `Gtk::ALIGN_CENTER`
| ) |  |

Sets the alignment of the frame widget's label.

The default values for a newly created frame are 0.0 and 0.5.

Parameters:

  xalign | The position of the label along the top edge of the widget. A value of 0.0 represents left alignment; 1.0 represents right alignment.
  yalign | The y alignment of the label. A value of 0.0 aligns under the frame; 1.0 aligns above the frame. If the values are exactly 0.0 or 1.0 the gap in the frame won't be painted because the label will be completely above or below the frame.

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

Sets the label widget for the frame.

This is the widget that will appear embedded in the top edge of the frame as a title.

Parameters:

  label_widget | The new label widget.

void Gtk::Frame::set_shadow_type | ( | ShadowType | type | ) |

Sets shadow type of the frame.

void Gtk::Frame::unset_label | ( |  | ) |

## Friends And Related Function Documentation

Gtk::Frame* wrap | ( | GtkFrame * | 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/frame.h