Main Page Widgets Namespaces Book

# Gtk::Bin Class Reference
[Widgets]

A container with just one child. More...

Inheritance diagram for Gtk::Bin:

[legend]
List of all members.

## Public Methods
virtual | ~Bin ()
GtkBin* | gobj ()
| Provides access to the underlying C GtkObject.
const GtkBin* | gobj () const
| Provides access to the underlying C GtkObject.
Widget* | get_child ()
const Widget* | get_child () const
void | remove ()
| Remove the contained object Since this can only hold one object it is not necessary to specify which object to remove like other containers.
void | add_label (const Glib::ustring& label, bool mnemonic=false, double x_align=0.5, double y_align=0.5)
| Add a Label object.
void | add_label (const Glib::ustring& label, bool mnemonic, AlignmentEnum x_align, AlignmentEnum y_align=ALIGN_CENTER)
| Add a Label object.
void | add_pixmap (const Glib::RefPtr<Gdk::Pixmap>& pixmap, const Glib::RefPtr<Gdk::Bitmap>& mask)
| Add an Image object.
void | add_pixlabel (const Glib::RefPtr<Gdk::Pixmap>& pixmap, const Glib::RefPtr<Gdk::Bitmap>& mask, const Glib::ustring& label, double x_align=0.5, double y_align=0.5)
| Add Image and Label objects.
void | add_pixlabel (const Glib::ustring& pixfile, const Glib::ustring& label, double x_align=0.5, double y_align=0.5)
| Add Image and Label objects.
## Protected Methods
| Bin ()
## Related Functions
(Note that these are not member functions.)
Gtk::Bin* | wrap (GtkBin* object, bool take_copy=false)

## Detailed Description

A container with just one child.

This is an abstract base class from which all classes holding up to 1 widget inside of them derive. It provides access to methods relevent to a single object, such as add_label, add_pixmap, etc.

## Constructor & Destructor Documentation

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

Gtk::Bin::Bin | ( |  | ) | `[protected]`

## Member Function Documentation

void Gtk::Bin::add_label | ( | const Glib::ustring& | label,
|  | bool | mnemonic,
|  | AlignmentEnum | x_align,
|  | AlignmentEnum | y_align = ALIGN_CENTER
| ) |

  | Add a Label object. This does not correspond to any GTK+ function and is provided purely for convenience. Parameters:
  label | The label text.
  mnemonic | If `true`, characters preceded by an underscore (_) will be underlined and used as a keyboard accelerator (shortcut).
  x_align | The horizontal alignment of the text. For possible values, see Gtk::AlignmentEnum.
  y_align | The vertical alignment of the text. For possible values, see Gtk::AlignmentEnum.

void Gtk::Bin::add_label | ( | const Glib::ustring& | label,
|  | bool | mnemonic = false,
|  | double | x_align = 0.5,
|  | double | y_align = 0.5
| ) |

  | Add a Label object. This does not correspond to any GTK+ function and is provided purely for convenience. Parameters:
  label | The text for the label.
  mnemonic | If `true`, characters preceded by an underscore (_) will be underlined and used as a keyboard accelerator (shortcut).
  x_align | The horizontal alignment of the text. This ranges from 0.0 (left aligned) to 1.0 (right aligned).
  y_align | The vertical alignment of the text. This ranges from 0.0 (top aligned) to 1.0 (bottom aligned).

void Gtk::Bin::add_pixlabel | ( | const Glib::ustring& | pixfile,
|  | const Glib::ustring& | label,
|  | double | x_align = 0.5,
|  | double | y_align = 0.5
| ) |

  | Add Image and Label objects. This does not correspond to any GTK+ function and is provided purely for convenience. This will create, manage, add, and show a new Image and Label (within an HBox) to this Bin. Parameters:
  pixfile | The path to a file to be displayed.
  label | The text for the label.
  x_align | The horizontal alignment of the text in the label.
  y_align | The vertical alignment of the text in the label.

void Gtk::Bin::add_pixlabel | ( | const Glib::RefPtr<Gdk::Pixmap>& | pixmap,
|  | const Glib::RefPtr<Gdk::Bitmap>& | mask,
|  | const Glib::ustring& | label,
|  | double | x_align = 0.5,
|  | double | y_align = 0.5
| ) |

  | Add Image and Label objects. This does not correspond to any GTK+ function and is provided purely for convenience. This will create, manage, add, and show a new Image and Label (within an HBox) to this Bin. Parameters:
  pixmap | A Glib::RefPtr to a Gdk::Pixmap.
  mask | A Glib::RefPtr to a Gdk::Bitmap.
  label | The text for the label.
  x_align | The horizontal alignment of the text in the label.
  y_align | The vertical alignment of the text in the label.

void Gtk::Bin::add_pixmap | ( | const Glib::RefPtr<Gdk::Pixmap>& | pixmap,
|  | const Glib::RefPtr<Gdk::Bitmap>& | mask
| ) |

  | Add an Image object. This does not correspond to any GTK+ function and is provided purely for convenience. This will create, manage, add, and show a new Image to this Bin. Parameters:
  pixmap | A Glib::RefPtr to a Gdk::Pixmap.
  mask | A Glib::RefPtr to a Gdk::Bitmap.

const Widget* Gtk::Bin::get_child | ( |  | ) |

Widget* Gtk::Bin::get_child | ( |  | ) |

const GtkBin* Gtk::Bin::gobj | ( |  | ) | const`[inline]`

| Provides access to the underlying C GtkObject. Reimplemented from Gtk::Container. Reimplemented in Gtk::Alignment, Gtk::AspectFrame, Gtk::Button, Gtk::CheckButton, Gtk::CheckMenuItem, Gtk::ColorSelectionDialog, Gtk::ComboDropDownItem, Gtk::Dialog, Gtk::EventBox, Gtk::FileSelection, Gtk::FontSelectionDialog, Gtk::Frame, Gtk::HandleBox, Gtk::ImageMenuItem, Gtk::InputDialog, Gtk::Item, Gtk::MenuItem, Gtk::MessageDialog, Gtk::OptionMenu, Gtk::Plug, Gtk::RadioButton, Gtk::RadioMenuItem, Gtk::ScrolledWindow, Gtk::SeparatorMenuItem, Gtk::TearoffMenuItem, Gtk::ToggleButton, Gtk::Viewport, and Gtk::Window.

GtkBin* Gtk::Bin::gobj | ( |  | ) | `[inline]`

| Provides access to the underlying C GtkObject. Reimplemented from Gtk::Container. Reimplemented in Gtk::Alignment, Gtk::AspectFrame, Gtk::Button, Gtk::CheckButton, Gtk::CheckMenuItem, Gtk::ColorSelectionDialog, Gtk::ComboDropDownItem, Gtk::Dialog, Gtk::EventBox, Gtk::FileSelection, Gtk::FontSelectionDialog, Gtk::Frame, Gtk::HandleBox, Gtk::ImageMenuItem, Gtk::InputDialog, Gtk::Item, Gtk::MenuItem, Gtk::MessageDialog, Gtk::OptionMenu, Gtk::Plug, Gtk::RadioButton, Gtk::RadioMenuItem, Gtk::ScrolledWindow, Gtk::SeparatorMenuItem, Gtk::TearoffMenuItem, Gtk::ToggleButton, Gtk::Viewport, and Gtk::Window.

void Gtk::Bin::remove | ( |  | ) |

| Remove the contained object Since this can only hold one object it is not necessary to specify which object to remove like other containers. When calling remove() on a Gtk::ScrolledWindow this might not remove the expected child directly, because Gtk::ScrolledWindow::add() sometimes creates a Gtk::ViewPort child and places the widget in that.

## Friends And Related Function Documentation

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

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

- bin.h