2
// Generated by gtkmmproc -- DO NOT MODIFY!
9
/* $Id: bin.hg,v 1.2 2003/03/03 07:49:05 murrayc Exp $ */
13
* Copyright (C) 1998-2002 The gtkmm Development Team
15
* This library is free software; you can redistribute it and/or
16
* modify it under the terms of the GNU Lesser General Public
17
* License as published by the Free Software Foundation; either
18
* version 2.1 of the License, or (at your option) any later version.
20
* This library is distributed in the hope that it will be useful,
21
* but WITHOUT ANY WARRANTY; without even the implied warranty of
22
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23
* Lesser General Public License for more details.
25
* You should have received a copy of the GNU Lesser General Public
26
* License along with this library; if not, write to the Free
27
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30
#include <gtkmm/container.h>
33
#ifndef DOXYGEN_SHOULD_SKIP_THIS
34
typedef struct _GtkBin GtkBin;
35
typedef struct _GtkBinClass GtkBinClass;
36
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
40
{ class Bin_Class; } // namespace Gtk
44
/** A container with just one child.
46
* This is an abstract base class from which all classes holding
47
* up to 1 widget inside of them derive. It provides access to methods
48
* relevent to a single object, such as add_label, add_pixmap, etc.
53
class Bin : public Container
56
#ifndef DOXYGEN_SHOULD_SKIP_THIS
57
typedef Bin CppObjectType;
58
typedef Bin_Class CppClassType;
59
typedef GtkBin BaseObjectType;
60
typedef GtkBinClass BaseClassType;
61
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
65
#ifndef DOXYGEN_SHOULD_SKIP_THIS
68
friend class Bin_Class;
69
static CppClassType bin_class_;
73
Bin& operator=(const Bin&);
76
explicit Bin(const Glib::ConstructParams& construct_params);
77
explicit Bin(GtkBin* castitem);
79
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
82
#ifndef DOXYGEN_SHOULD_SKIP_THIS
83
static GType get_type() G_GNUC_CONST;
86
static GType get_base_type() G_GNUC_CONST;
89
///Provides access to the underlying C GtkObject.
90
GtkBin* gobj() { return reinterpret_cast<GtkBin*>(gobject_); }
92
///Provides access to the underlying C GtkObject.
93
const GtkBin* gobj() const { return reinterpret_cast<GtkBin*>(gobject_); }
97
//C++ methods used to invoke GTK+ virtual functions:
100
//GTK+ Virtual Functions (override these to change behaviour):
102
//Default Signal Handlers::
109
/** This constructor is protected because only derived
110
* classes should be instantiated.
116
/** Gets the child of the Gtk::Bin, or <tt>0</tt> if the bin contains
117
* no child widget. The returned widget does not have a reference
118
* added, so you do not need to unref it.
119
* @return Pointer to child of the Gtk::Bin.
121
Gtk::Widget* get_child();
123
/** Gets the child of the Gtk::Bin, or <tt>0</tt> if the bin contains
124
* no child widget. The returned widget does not have a reference
125
* added, so you do not need to unref it.
126
* @return Pointer to child of the Gtk::Bin.
128
const Gtk::Widget* get_child() const;
130
/** Remove the contained object
131
* Since this can only hold one object it is not necessary to
132
* specify which object to remove like other containers.
134
* When calling remove() on a Gtk::ScrolledWindow this might not remove the
135
* expected child directly, because Gtk::ScrolledWindow::add() sometimes creates a
136
* Gtk::ViewPort child and places the widget in that.
140
//Convenience methods that don't correspond to GTK+ functions:
142
/** Add a Label object.
143
* This does not correspond to any GTK+ function and is provided purely for
145
* @param label The text for the label.
146
* @param mnemonic If <tt>true</tt>, characters preceded by an underscore
147
* (_) will be underlined and used as a keyboard accelerator (shortcut).
148
* @param x_align The horizontal alignment of the text. This ranges from
149
* 0.0 (left aligned) to 1.0 (right aligned).
150
* @param y_align The vertical alignment of the text. This ranges from
151
* 0.0 (top aligned) to 1.0 (bottom aligned).
153
void add_label(const Glib::ustring& label, bool mnemonic = false,
154
double x_align = 0.5, double y_align = 0.5);
156
/** Add a Label object.
157
* This does not correspond to any GTK+ function and is provided purely for
159
* @param label The label text.
160
* @param mnemonic If <tt>true</tt>, characters preceded by an underscore
161
* (_) will be underlined and used as a keyboard accelerator (shortcut).
162
* @param x_align The horizontal alignment of the text. For possible
163
* values, see Gtk::AlignmentEnum.
164
* @param y_align The vertical alignment of the text. For possible
165
* values, see Gtk::AlignmentEnum.
167
void add_label(const Glib::ustring& label, bool mnemonic,
168
AlignmentEnum x_align, AlignmentEnum y_align = ALIGN_CENTER);
170
/** Add an Image object.
171
* This does not correspond to any GTK+ function and is provided purely for
173
* This will create, manage, add, and show a new Image to this Bin.
174
* @param pixmap A Glib::RefPtr to a Gdk::Pixmap.
175
* @param mask A Glib::RefPtr to a Gdk::Bitmap.
177
void add_pixmap(const Glib::RefPtr<Gdk::Pixmap>& pixmap,
178
const Glib::RefPtr<Gdk::Bitmap>& mask);
180
/** Add Image and Label objects.
181
* This does not correspond to any GTK+ function and is provided purely for
183
* This will create, manage, add, and show a new Image and Label (within an
185
* @param pixmap A Glib::RefPtr to a Gdk::Pixmap.
186
* @param mask A Glib::RefPtr to a Gdk::Bitmap.
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::RefPtr<Gdk::Pixmap>& pixmap,
192
const Glib::RefPtr<Gdk::Bitmap>& mask,
193
const Glib::ustring& label,
194
double x_align = 0.5, double y_align = 0.5);
196
/** Add Image and Label objects.
197
* This does not correspond to any GTK+ function and is provided purely for
199
* This will create, manage, add, and show a new Image and Label (within an
201
* @param pixfile The path to a file to be displayed.
202
* @param label The text for the label.
203
* @param x_align The horizontal alignment of the text in the label.
204
* @param y_align The vertical alignment of the text in the label.
206
void add_pixlabel(const Glib::ustring& pixfile,
207
const Glib::ustring& label,
208
double x_align = 0.5, double y_align = 0.5);
213
} /* namespace Gtk */
218
/** A Glib::wrap() method for this object.
220
* @param object The C instance.
221
* @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
222
* @result A C++ instance that wraps this C instance.
226
Gtk::Bin* wrap(GtkBin* object, bool take_copy = false);
230
#endif /* _GTKMM_BIN_H */