public abstract class ButtonBox extends Box
HButtonBox
to lay buttons out horizontally or a VButtonBox
to lay buttons out vertically.
Buttons are packed into a ButtonBox the same way widgets are added to any
other Container, using add()
. You can also
use Box's packStart()
or
packEnd()
, but for ButtonBoxes both these
functions work just like add()
, ie., they pack the button in a
way that depends on the current layout style and on whether the button has
had setChildSecondary()
called for it.
The layout/spacing can be altered in a programmatic way in order to alter
the 'feel' of a program to a small degree, although in general overriding
the defaults used by every other application on the desktop will impact the
user's experience and so is not recommended. If you do need to make
adjustments, the arrangement and layout of the Buttons can be changed with
setLayout()
.
Widget.ButtonPressEvent, Widget.ButtonReleaseEvent, Widget.Destroy, Widget.Draw, Widget.EnterNotifyEvent, Widget.FocusInEvent, Widget.FocusOutEvent, Widget.Hide, Widget.KeyPressEvent, Widget.KeyReleaseEvent, Widget.LeaveNotifyEvent, Widget.MapEvent, Widget.MotionNotifyEvent, Widget.PopupMenu, Widget.QueryTooltip, Widget.ScrollEvent, Widget.SizeAllocate, Widget.UnmapEvent, Widget.VisibilityNotifyEvent
Modifier and Type | Method and Description |
---|---|
boolean |
getChildSecondary(Widget child)
Returns whether child should appear in a secondary group of
children.
|
ButtonBoxStyle |
getLayout()
Returns the method currently being used to govern arrangement child
Buttons in this ButtonBox.
|
void |
setChildSecondary(Widget child,
boolean isSecondary)
Sets whether
child should appear in the "secondary" group
of children. |
void |
setLayout(ButtonBoxStyle layout)
Change the way the child Buttons are arranged in this ButtonBox.
|
getOrientation, getSpacing, packEnd, packStart, reorderChild, setOrientation, setSpacing
add, getChildren, remove, setBorderWidth
activate, addEvents, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, destroy, getAllocatedHeight, getAllocatedWidth, getAllocation, getCanDefault, getCanFocus, getHasFocus, getName, getParent, getPreferredHeightForWidthMinimum, getPreferredHeightForWidthNatural, getPreferredHeightMinimum, getPreferredHeightNatural, getPreferredWidthForHeightMinimum, getPreferredWidthForHeightNatural, getPreferredWidthMinimum, getPreferredWidthNatural, getRequestMode, getRequisition, getSensitive, getStyleContext, getToplevel, getWindow, grabAdd, grabDefault, grabFocus, grabRemove, hide, isSensitive, overrideBackground, overrideColor, overrideFont, queueDraw, queueDrawArea, realize, setAlignHorizontal, setAlignVertical, setCanDefault, setCanFocus, setEvents, setExpandHorizontal, setExpandVertical, setName, setSensitive, setSizeRequest, setTooltipMarkup, setTooltipText, show, showAll
public boolean getChildSecondary(Widget child)
child
- a widget that is a child of this button boxpublic ButtonBoxStyle getLayout()
public void setChildSecondary(Widget child, boolean isSecondary)
child
should appear in the "secondary" group
of children. A typical use of the secondary child mechanism is to place
the 'Help' Button in a Dialog; placing it on the far left side while
the 'Ok' and 'Cancel' Buttons are on the far right.
The secondary group appears after the other children if the
ButtonBoxStyle is START
,
SPREAD
, or EDGE
, and before the other children if the it is
END
. For horizontal ButtonBoxes, the
definition of before/after depends on direction in place (see
setDirection()
on Widget).
If the style is START
or
END
, then the secondary children are aligned
at the other end of the ButtonBox from the main children. For the other
styles, they appear immediately next to the main children.
child
- a Widget that is a child of this ButtonBoxisSecondary
- if true
, the child appears in a secondary group
of the ButtonBoxpublic void setLayout(ButtonBoxStyle layout)
ButtonBoxStyle
for the list of possible constants; and see also
setChildSecondary()
for
discussion of the impact of these different possibilities.