org.gnome.gtk
Class Box
java.lang.Object
org.freedesktop.bindings.Proxy
public abstract class Box
Base class for Containers which organize a variable number of Widgets into
a rectangular area. This is either a single row of child Widgets (in the
case of
HBox
), or a single column (for the case of
VBox
). All the children of a Box are allocated one dimension
in common, being the height of a row, or the width of a column,
respectively.
Nested combinations of VBoxes and HBoxes are the cornerstone layout
technique used in GTK. A top level VBox to organize a Window is followed by
a sequence Widgets, many of which will end up being HBoxes, and each of
those in turn might contain further Containers. This sort of thing gives
you great flexibility when laying out your user interface.
Boxes are also used to enable grouping of Widgets at very small scales as
well. For example, the ok Button you see in every GNOME dialog is actually
an Image holding the icon and a Label with the text "OK" packed into an
HBox; the HBox is what was actually added to the Button!
void | packStart(Widget child) - Add a Widget to the beginning of the Box, with default padding values.
|
void | packStart(Widget child, boolean expand, boolean fill, int padding) - Add a Widget to the beginning of the Box.
|
packStart
public void packStart(Widget child)
Add a Widget to the beginning of the Box, with default padding values.
With only the
child
Widget to specify, this is easy to
use and suffices for most cases.
This is the same as calling
packStart(child, true, true, 0)
; see the full
packStart()
for
details.
packStart
public void packStart(Widget child,
boolean expand,
boolean fill,
int padding)
Add a Widget to the beginning of the Box. Widget child will be ordered
after any other Widgets that have already been packed with respect to
the start of the Box, but before any Widgets that are packed at the end
of the Box with packEnd()
.
child
- the Widget to be addedexpand
- Whether the new child
is to be given extra
space allocated to Box. The extra space will be divided
evenly between all children of this Box that were added with
expand
set to true
.fill
- Whether space given to child
by the
expand
option is actually allocated to child.
If you specify false
here, then any extra
space will padding the Widget, rather than causing it to
grow larger.padding
- extra space (in pixels) to put between this child and its
neighbours. This is over and above the global amount of
padding that was specified by the spacing
parameter when the Box was constructed. If
child
is the Widget at one of the start of
the Box, then padding
pixels are also put
between the Widget and the leading edge.
|  java-gnome |