gtkmm: Gtk::Bin Class Reference

A container with just one child. More...

Inheritance diagram for Gtk::Bin:
Collaboration diagram for Gtk::Bin:

List of all members.

Public Member Functions

virtual ~Bin ()
GtkBin* gobj ()
 Provides access to the underlying C GtkObject.

const GtkBin* gobj () const
 Provides access to the underlying C GtkObject.

Gtk::Widgetget_child ()
 Gets the child of the Gtk::Bin, or 0 if the bin contains no child widget.

const Gtk::Widgetget_child () const
 Gets the child of the Gtk::Bin, or 0 if the bin contains no child widget.

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, Align x_align, Align y_align=ALIGN_CENTER)
 Add a Label object.

void add_pixlabel (const std::string& pixfile, const Glib::ustring& label, double x_align=0.5, double y_align=0.5)
 Add Image and Label objects.

Protected Member Functions

 Bin ()
 This constructor is protected because only derived classes should be instantiated.

Related Functions

(Note that these are not member functions.)

Gtk::Binwrap (GtkBin* object, bool take_copy=false)
 A Glib::wrap() method for this object.


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, etc.


Constructor & Destructor Documentation

virtual Gtk::Bin::~Bin ( ) [virtual]
Gtk::Bin::Bin ( ) [protected]

This constructor is protected because only derived classes should be instantiated.


Member Function Documentation

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:
labelThe text for the label.
mnemonicIf true, characters preceded by an underscore (_) will be underlined and used as a keyboard accelerator (shortcut).
x_alignThe horizontal alignment of the text. This ranges from 0.0 (left aligned) to 1.0 (right aligned).
y_alignThe vertical alignment of the text. This ranges from 0.0 (top aligned) to 1.0 (bottom aligned).
void Gtk::Bin::add_label ( const Glib::ustring label,
bool  mnemonic,
Align  x_align,
Align  y_align = ALIGN_CENTER 
)

Add a Label object.

This does not correspond to any GTK+ function and is provided purely for convenience.

Parameters:
labelThe label text.
mnemonicIf true, characters preceded by an underscore (_) will be underlined and used as a keyboard accelerator (shortcut).
x_alignThe horizontal alignment of the text. For possible values, see Gtk::Align.
y_alignThe vertical alignment of the text. For possible values, see Gtk::Align.
void Gtk::Bin::add_pixlabel ( const std::string 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:
pixmapA Glib::RefPtr to a Gdk::Pixmap.
maskA Glib::RefPtr to a Gdk::Bitmap.
labelThe text for the label.
x_alignThe horizontal alignment of the text in the label.
y_alignThe vertical alignment of the text in the label. 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.
pixfileThe path to a file to be displayed.
labelThe text for the label.
x_alignThe horizontal alignment of the text in the label.
y_alignThe vertical alignment of the text in the label.
const Gtk::Widget* Gtk::Bin::get_child ( ) const

Gets the child of the Gtk::Bin, or 0 if the bin contains no child widget.

The returned widget does not have a reference added, so you do not need to unref it.

Returns:
Pointer to child of the Gtk::Bin.
Gtk::Widget* Gtk::Bin::get_child ( )

Gets the child of the Gtk::Bin, or 0 if the bin contains no child widget.

The returned widget does not have a reference added, so you do not need to unref it.

Returns:
Pointer to child of the Gtk::Bin.
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]

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

Parameters:
objectThe C instance.
take_copyFalse 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/bin.h