public class Expander extends Bin
This Container is useful for hiding advanced options from a Dialog, while still providing a way to let users access those options. You usually specify a text label that is show near the expander triangle that contains a brief description of the hidden elements.
To add the child Widget, you should use the Container
add()
method, as follows:
Widget advancedOptionsWidget; Expander advancedOptions; // create a Widget with some options we want to hide advancedOptionsWidget = ... advancedOptions = new Expander("Advanced Options"); advancedOptions.add(advancedOptionsWidget);Note that the child Widget is hidden by default, you can use the
setExpanded()
method to show it from the
beginning.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
Constructor and Description |
---|
Expander(String label)
Create a new Expander with the given label.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getExpanded()
Get the expanded state of this Expander, i.e., whether its child is
shown or hidden.
|
void |
setExpanded(boolean expanded)
Set the state of this Expander.
|
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 Expander(String label)
public boolean getExpanded()
public void setExpanded(boolean expanded)
expanded
- true
to show the child Widget,
false
to hide it.