Package ch.bailu.gtk.gtk
Klasse Box
- Alle implementierten Schnittstellen:
PointerInterface
- Bekannte direkte Unterklassen:
ShortcutsGroup,ShortcutsSection
Arranges child widgets into a single row or column.
<picture>
<source srcset="box-dark.png" media="(prefers-color-scheme: dark)">
<img alt="An example GtkBox" src="box.png">
</picture>
Whether it is a row or column depends on the value of its
[property@Gtk.Orientable:orientation] property. Within the other
dimension, all children are allocated the same size. The
[property@Gtk.Widget:halign] and [property@Gtk.Widget:valign]
properties can be used on the children to influence their allocation.
Use repeated calls to [method@Gtk.Box.append] to pack widgets into a
`GtkBox` from start to end. Use [method@Gtk.Box.remove] to remove widgets
from the `GtkBox`. [method@Gtk.Box.insert_child_after] can be used to add
a child at a particular position.
Use [method@Gtk.Box.set_homogeneous] to specify whether or not all children
of the `GtkBox` are forced to get the same amount of space.
Use [method@Gtk.Box.set_spacing] to determine how much space will be minimally
placed between all children in the `GtkBox`. Note that spacing is added
*between* the children.
Use [method@Gtk.Box.reorder_child_after] to move a child to a different
place in the box.
# CSS nodes
`GtkBox` uses a single CSS node with name box.
# Accessibility
Until GTK 4.10, `GtkBox` used the [enum@Gtk.AccessibleRole.group] role.
Starting from GTK 4.12, `GtkBox` uses the [enum@Gtk.AccessibleRole.generic] role.
<picture>
<source srcset="box-dark.png" media="(prefers-color-scheme: dark)">
<img alt="An example GtkBox" src="box.png">
</picture>
Whether it is a row or column depends on the value of its
[property@Gtk.Orientable:orientation] property. Within the other
dimension, all children are allocated the same size. The
[property@Gtk.Widget:halign] and [property@Gtk.Widget:valign]
properties can be used on the children to influence their allocation.
Use repeated calls to [method@Gtk.Box.append] to pack widgets into a
`GtkBox` from start to end. Use [method@Gtk.Box.remove] to remove widgets
from the `GtkBox`. [method@Gtk.Box.insert_child_after] can be used to add
a child at a particular position.
Use [method@Gtk.Box.set_homogeneous] to specify whether or not all children
of the `GtkBox` are forced to get the same amount of space.
Use [method@Gtk.Box.set_spacing] to determine how much space will be minimally
placed between all children in the `GtkBox`. Note that spacing is added
*between* the children.
Use [method@Gtk.Box.reorder_child_after] to move a child to a different
place in the box.
# CSS nodes
`GtkBox` uses a single CSS node with name box.
# Accessibility
Until GTK 4.10, `GtkBox` used the [enum@Gtk.AccessibleRole.group] role.
Starting from GTK 4.12, `GtkBox` uses the [enum@Gtk.AccessibleRole.generic] role.
-
Verschachtelte Klassen - Übersicht
Von Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gtk.Widget
Widget.OnDestroy, Widget.OnDestroyNotify, Widget.OnDirectionChanged, Widget.OnHide, Widget.OnKeynavFailed, Widget.OnMap, Widget.OnMnemonicActivate, Widget.OnMoveFocus, Widget.OnQueryTooltip, Widget.OnRealize, Widget.OnShow, Widget.OnStateFlagsChanged, Widget.OnTickCallback, Widget.OnUnmap, Widget.OnUnrealizeVon Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify -
Feldübersicht
Von Klasse geerbte Felder ch.bailu.gtk.gtk.Widget
SIGNAL_ON_DESTROY, SIGNAL_ON_DIRECTION_CHANGED, SIGNAL_ON_HIDE, SIGNAL_ON_KEYNAV_FAILED, SIGNAL_ON_MAP, SIGNAL_ON_MNEMONIC_ACTIVATE, SIGNAL_ON_MOVE_FOCUS, SIGNAL_ON_QUERY_TOOLTIP, SIGNAL_ON_REALIZE, SIGNAL_ON_SHOW, SIGNAL_ON_STATE_FLAGS_CHANGED, SIGNAL_ON_UNMAP, SIGNAL_ON_UNREALIZEVon Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungBox(int orientation, int spacing) Creates a new box.Box(PointerContainer pointer) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidAdds a child at the end.Implements interfaceAccessible.Implements interfaceBuildable.Implements interfaceConstraintTarget.Implements interfaceOrientable.intGets the value set by [method@Gtk.Box.set_baseline_child].intGets the value set by [method@Gtk.Box.set_baseline_position].static ClassHandlerbooleanReturns whether the box is homogeneous.static intstatic longstatic TypeSystem.TypeSizeintGets the value set by [method@Gtk.Box.set_spacing].static longstatic TypeSystem.TypeSizevoidinsertChildAfter(Widget child, Widget sibling) Inserts a child at a specific position.voidAdds a child at the beginning.voidRemoves a child widget from the box.voidreorderChildAfter(Widget child, Widget sibling) Moves a child to a different position.voidsetBaselineChild(int child) Sets the baseline child of a box.voidsetBaselinePosition(int position) Sets the baseline position of a box.voidsetHomogeneous(boolean homogeneous) Sets whether or not all children are given equal space
in the box.voidsetSpacing(int spacing) Sets the number of pixels to place between children.Von Klasse geerbte Methoden ch.bailu.gtk.gtk.Widget
actionSetEnabled, actionSetEnabled, activate, activateAction, activateAction, activateActionVariant, activateActionVariant, activateDefault, addController, addCssClass, addCssClass, addMnemonicLabel, addTickCallback, allocate, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getBaseline, getCanFocus, getCanTarget, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getDefaultDirection, getDirection, getDisplay, getFirstChild, getFocusable, getFocusChild, getFocusOnClick, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getLimitEvents, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth, grabFocus, hasCssClass, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, observeChildren, observeControllers, onDestroy, onDirectionChanged, onHide, onKeynavFailed, onMap, onMnemonicActivate, onMoveFocus, onQueryTooltip, onRealize, onShow, onStateFlagsChanged, onUnmap, onUnrealize, pick, queueAllocate, queueDraw, queueResize, realize, removeController, removeCssClass, removeCssClass, removeMnemonicLabel, removeTickCallback, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setCursorFromName, setDefaultDirection, setDirection, setFocusable, setFocusChild, setFocusOnClick, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setLimitEvents, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setName, setOpacity, setOverflow, setParent, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipMarkup, setTooltipText, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, shouldLayout, show, sizeAllocate, snapshotChild, triggerTooltipQuery, unmap, unparent, unrealize, unsetStateFlagsVon Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrPropertyVon Klasse geerbte Methoden ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnrefVon Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacksVon Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNullVon Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitVon Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Konstruktordetails
-
Box
-
Box
public Box(int orientation, int spacing) Creates a new box.- Parameter:
orientation- the box’s orientationspacing- the number of pixels to place between children
-
-
Methodendetails
-
getClassHandler
-
append
Adds a child at the end.- Parameter:
child- the widget to append
-
getBaselineChild
public int getBaselineChild()Gets the value set by [method@Gtk.Box.set_baseline_child].- Gibt zurück:
- the baseline child
-
getBaselinePosition
public int getBaselinePosition()Gets the value set by [method@Gtk.Box.set_baseline_position].- Gibt zurück:
- the baseline position
-
getHomogeneous
public boolean getHomogeneous()Returns whether the box is homogeneous.
In a homogeneous box all children are the same size.- Gibt zurück:
- true if the box is homogeneous
-
getSpacing
public int getSpacing()Gets the value set by [method@Gtk.Box.set_spacing].- Gibt zurück:
- spacing between children
-
insertChildAfter
Inserts a child at a specific position.
The child is added after @sibling in the list of @box children.
If @sibling is `NULL`, the @child is placed at the beginning.- Parameter:
child- the widget to insertsibling- the sibling after which to insert @child
-
prepend
Adds a child at the beginning.- Parameter:
child- the widget to prepend
-
remove
Removes a child widget from the box.
The child must have been added before with
[method@Gtk.Box.append], [method@Gtk.Box.prepend], or
[method@Gtk.Box.insert_child_after].- Parameter:
child- the child to remove
-
reorderChildAfter
Moves a child to a different position.
The child is moved to the position after @sibling in the list
of @box children.
If @sibling is `NULL`, the child is placed at the beginning.- Parameter:
child- the widget to move, must be a child of @boxsibling- the sibling to move @child after
-
setBaselineChild
public void setBaselineChild(int child) Sets the baseline child of a box.
This affects only vertical boxes.- Parameter:
child- a child position, or -1
-
setBaselinePosition
public void setBaselinePosition(int position) Sets the baseline position of a box.
This affects only horizontal boxes with at least one baseline
aligned child. If there is more vertical space available than
requested, and the baseline is not allocated by the parent then
@position is used to allocate the baseline with respect to the
extra space available.- Parameter:
position- the baseline position
-
setHomogeneous
public void setHomogeneous(boolean homogeneous) Sets whether or not all children are given equal space
in the box.- Parameter:
homogeneous- true to create equal allotments, false for variable allotments
-
setSpacing
public void setSpacing(int spacing) Sets the number of pixels to place between children.- Parameter:
spacing- the number of pixels to put between children
-
asAccessible
Implements interfaceAccessible. Call this to get access to interface functions.- Setzt außer Kraft:
asAccessiblein KlasseWidget- Gibt zurück:
Accessible
-
asBuildable
Implements interfaceBuildable. Call this to get access to interface functions.- Setzt außer Kraft:
asBuildablein KlasseWidget- Gibt zurück:
Buildable
-
asConstraintTarget
Implements interfaceConstraintTarget. Call this to get access to interface functions.- Setzt außer Kraft:
asConstraintTargetin KlasseWidget- Gibt zurück:
ConstraintTarget
-
asOrientable
Implements interfaceOrientable. Call this to get access to interface functions.- Gibt zurück:
Orientable
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-