The Container widget is a base class for container widgets. Widgets that
inherit from Container have the ability to contain, position, size, and
display one or more other widgets.
add
public void add(Widget widget)
Adds widget to the Container.
widget
- The Widget to be added to this Container.
addListener
public void addListener(ContainerListener listener)
Register an object to handle container events.
getBooleanChildProperty
public boolean getBooleanChildProperty(Widget child,
String name)
Convenience method for retrieving boolean child properties.
child
- A widget which is a child of container.name
- The name of the property to retrieve.
- The value of the given child property.
getBorderWidth
public int getBorderWidth()
Retrieves the border width for the Container.
getChildProperty
public Value getChildProperty(Widget child,
String name)
Get the
Value
of the given child property (
name).
Container introduces child properties - these are object properties
that are not specific to either the container or the contained widget,
but rather to their relation. Typical examples of child properties are
the position or pack-type of a widget which is contained in a Box.
NOTE: Prefer using one of the convenience methods over using this
method directly.
child
- A widget which is a child of container.name
- The name of the child property to retrieve.
- The value of the given child property.
getChildren
public Widget[] getChildren()
Get an array of all children of this container.
- An array contain all children of this container or null.
getIntChildProperty
public int getIntChildProperty(Widget child,
String name)
Convenience method for retrieving int child properties.
child
- A widget which is a child of container.name
- The name of the property to retrieve.
- The value of the given child property.
getResizeMode
public ResizeMode getResizeMode()
Returns the ResizeMode for the Container.
- The ResizeMode for the Container.
getType
public static Type getType()
Retrieve the runtime type used by the GLib library.
- getType in interface Widget
remove
public void remove(Widget widget)
Remove a Widget from the Container.
widget
- The Widget to remove from the Container.
removeListener
public void removeListener(ContainerListener listener)
Removes a listener
resizeChildren
public void resizeChildren()
Informs the container to resize all of its' children based on the size
requirements of the children.
setBooleanChildProperty
public void setBooleanChildProperty(Widget child,
String name,
boolean value)
Convenience method for setting boolean child properties.
child
- A widget which is a child of container.name
- The name of the property to set.value
- The value to set in the property.
setBorderWidth
public void setBorderWidth(int width)
Sets the border width for the Container.
width
- The border width.
setChildProperty
public void setChildProperty(Widget child,
String name,
Value val)
Set the given child property (
name) with the given
Value
in this container. Container introduces child
properties - these are object properties that are not specific to either
the container or the contained widget, but rather to their relation.
Typical examples of child properties are the position or pack-type of a
widget which is contained in a Box.
NOTE: Prefer using one of the convenience methods over using this
method directly.
child
- a widget which is a child of container.name
- The name of the property to set.val
- The value to set in the property.
setIntChildProperty
public void setIntChildProperty(Widget child,
String name,
int value)
Convenience method for setting int child properties.
child
- A widget which is a child of container.name
- The name of the property to set.value
- The value to set in the property.
setResizeMode
public void setResizeMode(ResizeMode mode)
Sets the ResizeMode for the Container.