2 // Generated by gtkmmproc -- DO NOT MODIFY!
12 * Copyright (C) 1998-2002 The gtkmm Development Team
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Library General Public
16 * License as published by the Free Software Foundation; either
17 * version 2 of the License, or (at your option) any later version.
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Library General Public License for more details.
24 * You should have received a copy of the GNU Library General Public
25 * License along with this library; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 #include <gtkmm/container.h>
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 typedef struct _GtkBin GtkBin;
34 typedef struct _GtkBinClass GtkBinClass;
35 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
39 { class Bin_Class; } // namespace Gtk
43 /** A container with just one child.
45 * This is an abstract base class from which all classes holding
46 * up to 1 widget inside of them derive. It provides access to methods
47 * relevent to a single object, such as add_label, add_pixmap, etc.
52 class Bin : public Container
55 #ifndef DOXYGEN_SHOULD_SKIP_THIS
56 typedef Bin CppObjectType;
57 typedef Bin_Class CppClassType;
58 typedef GtkBin BaseObjectType;
59 typedef GtkBinClass BaseClassType;
60 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
64 #ifndef DOXYGEN_SHOULD_SKIP_THIS
67 friend class Bin_Class;
68 static CppClassType bin_class_;
72 Bin& operator=(const Bin&);
75 explicit Bin(const Glib::ConstructParams& construct_params);
76 explicit Bin(GtkBin* castitem);
78 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
81 #ifndef DOXYGEN_SHOULD_SKIP_THIS
82 static GType get_type() G_GNUC_CONST;
83 static GType get_base_type() G_GNUC_CONST;
86 ///Provides access to the underlying C GtkObject.
87 GtkBin* gobj() { return reinterpret_cast<GtkBin*>(gobject_); }
89 ///Provides access to the underlying C GtkObject.
90 const GtkBin* gobj() const { return reinterpret_cast<GtkBin*>(gobject_); }
94 //C++ methods used to invoke GTK+ virtual functions:
97 //GTK+ Virtual Functions (override these to change behaviour):
99 //Default Signal Handlers::
109 // get_child() is a convenience function to get a c++ wrapper of
110 // the contained widget. It may return NULL if such an item is not
113 const Widget* get_child() const;
115 /** Remove the contained object
116 * Since this can only hold one object it is not necessary to
117 * specify which object to remove like other containers.
119 * When calling remove() on a Gtk::ScrolledWindow this might not remove the
120 * expected child directly, because Gtk::ScrolledWindow::add() sometimes creates a
121 * Gtk::ViewPort child and places the widget in that.
125 //Convenience methods that don't correspond to GTK+ functions:
127 /** Add a Label object.
128 * This does not correspond to any GTK+ function and is provided purely for
130 * @param label The text for the label.
131 * @param mnemonic If <tt>true</tt>, characters preceded by an underscore
132 * (_) will be underlined and used as a keyboard accelerator (shortcut).
133 * @param x_align The horizontal alignment of the text. This ranges from
134 * 0.0 (left aligned) to 1.0 (right aligned).
135 * @param y_align The vertical alignment of the text. This ranges from
136 * 0.0 (top aligned) to 1.0 (bottom aligned).
138 void add_label(const Glib::ustring& label, bool mnemonic = false,
139 double x_align = 0.5, double y_align = 0.5);
141 /** Add a Label object.
142 * This does not correspond to any GTK+ function and is provided purely for
144 * @param label The label text.
145 * @param mnemonic If <tt>true</tt>, characters preceded by an underscore
146 * (_) will be underlined and used as a keyboard accelerator (shortcut).
147 * @param x_align The horizontal alignment of the text. For possible
148 * values, see Gtk::AlignmentEnum.
149 * @param y_align The vertical alignment of the text. For possible
150 * values, see Gtk::AlignmentEnum.
152 void add_label(const Glib::ustring& label, bool mnemonic,
153 AlignmentEnum x_align, AlignmentEnum y_align = ALIGN_CENTER);
155 /** Add an Image object.
156 * This does not correspond to any GTK+ function and is provided purely for
158 * This will create, manage, add, and show a new Image to this Bin.
159 * @param pixmap A Glib::RefPtr to a Gdk::Pixmap.
160 * @param mask A Glib::RefPtr to a Gdk::Bitmap.
162 void add_pixmap(const Glib::RefPtr<Gdk::Pixmap>& pixmap,
163 const Glib::RefPtr<Gdk::Bitmap>& mask);
165 /** Add Image and Label objects.
166 * This does not correspond to any GTK+ function and is provided purely for
168 * This will create, manage, add, and show a new Image and Label (within an
170 * @param pixmap A Glib::RefPtr to a Gdk::Pixmap.
171 * @param mask A Glib::RefPtr to a Gdk::Bitmap.
172 * @param label The text for the label.
173 * @param x_align The horizontal alignment of the text in the label.
174 * @param y_align The vertical alignment of the text in the label.
176 void add_pixlabel(const Glib::RefPtr<Gdk::Pixmap>& pixmap,
177 const Glib::RefPtr<Gdk::Bitmap>& mask,
178 const Glib::ustring& label,
179 double x_align = 0.5, double y_align = 0.5);
181 /** Add Image and Label objects.
182 * This does not correspond to any GTK+ function and is provided purely for
184 * This will create, manage, add, and show a new Image and Label (within an
186 * @param pixfile The path to a file to be displayed.
187 * @param label The text for the label.
188 * @param x_align The horizontal alignment of the text in the label.
189 * @param y_align The vertical alignment of the text in the label.
191 void add_pixlabel(const Glib::ustring& pixfile,
192 const Glib::ustring& label,
193 double x_align = 0.5, double y_align = 0.5);
198 } /* namespace Gtk */
203 /** @relates Gtk::Bin
204 * @param object The C instance
205 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
206 * @result A C++ instance that wraps this C instance.
208 Gtk::Bin* wrap(GtkBin* object, bool take_copy = false);
210 #endif /* _GTKMM_BIN_H */