Package ch.bailu.gtk.gtk
Class Fixed
- All Implemented Interfaces:
PointerInterface
`GtkFixed` places its child widgets at fixed positions and with fixed sizes.
`GtkFixed` performs no automatic layout management.
For most applications, you should not use this container! It keeps
you from having to learn about the other GTK containers, but it
results in broken applications. With `GtkFixed`, the following
things will result in truncated text, overlapping widgets, and
other display bugs:
- Themes, which may change widget sizes.
- Fonts other than the one you used to write the app will of course
change the size of widgets containing text; keep in mind that
users may use a larger font because of difficulty reading the
default, or they may be using a different OS that provides different fonts.
- Translation of text into other languages changes its size. Also,
display of non-English text will use a different font in many
cases.
In addition, `GtkFixed` does not pay attention to text direction and
thus may produce unwanted results if your app is run under right-to-left
languages such as Hebrew or Arabic. That is: normally GTK will order
containers appropriately for the text direction, e.g. to put labels to
the right of the thing they label when using an RTL language, but it can’t
do that with `GtkFixed`. So if you need to reorder widgets depending on
the text direction, you would need to manually detect it and adjust child
positions accordingly.
Finally, fixed positioning makes it kind of annoying to add/remove
UI elements, since you have to reposition all the other elements. This
is a long-term maintenance problem for your application.
If you know none of these things are an issue for your application,
and prefer the simplicity of `GtkFixed`, by all means use the
widget. But you should be aware of the tradeoffs.
`GtkFixed` performs no automatic layout management.
For most applications, you should not use this container! It keeps
you from having to learn about the other GTK containers, but it
results in broken applications. With `GtkFixed`, the following
things will result in truncated text, overlapping widgets, and
other display bugs:
- Themes, which may change widget sizes.
- Fonts other than the one you used to write the app will of course
change the size of widgets containing text; keep in mind that
users may use a larger font because of difficulty reading the
default, or they may be using a different OS that provides different fonts.
- Translation of text into other languages changes its size. Also,
display of non-English text will use a different font in many
cases.
In addition, `GtkFixed` does not pay attention to text direction and
thus may produce unwanted results if your app is run under right-to-left
languages such as Hebrew or Arabic. That is: normally GTK will order
containers appropriately for the text direction, e.g. to put labels to
the right of the thing they label when using an RTL language, but it can’t
do that with `GtkFixed`. So if you need to reorder widgets depending on
the text direction, you would need to manually detect it and adjust child
positions accordingly.
Finally, fixed positioning makes it kind of annoying to add/remove
UI elements, since you have to reposition all the other elements. This
is a long-term maintenance problem for your application.
If you know none of these things are an issue for your application,
and prefer the simplicity of `GtkFixed`, by all means use the
widget. But you should be aware of the tradeoffs.
-
Nested Class Summary
Nested classes/interfaces inherited from class 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.OnUnrealize
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Fields inherited from class 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_UNREALIZE
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionImplements interfaceAccessible
.Implements interfaceBuildable
.Implements interfaceConstraintTarget
.getChildTransform
(Widget widget) Retrieves the transformation for @widget set using
gtk_fixed_set_child_transform().static ClassHandler
static int
static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
void
Sets a translation transformation to the given @x and @y
coordinates to the child @widget of the `GtkFixed`.void
Adds a widget to a `GtkFixed` at the given position.void
Removes a child from @fixed.void
setChildTransform
(Widget widget, Transform transform) Sets the transformation for @widget.Methods inherited from class 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, getCanFocus, getCanTarget, getChildVisible, getClipboard, getCssClasses, getCssName, getCursor, getDefaultDirection, getDirection, getDisplay, getFirstChild, getFocusable, getFocusChild, getFocusOnClick, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, 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, 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, unsetStateFlags
Methods inherited from class 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, weakUnref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Constructor Details
-
Fixed
-
Fixed
public Fixed()Creates a new `GtkFixed`.
-
-
Method Details
-
getClassHandler
-
getChildTransform
Retrieves the transformation for @widget set using
gtk_fixed_set_child_transform().- Parameters:
widget
- a `GtkWidget`, child of @fixed- Returns:
- a `GskTransform`
-
move
Sets a translation transformation to the given @x and @y
coordinates to the child @widget of the `GtkFixed`.- Parameters:
widget
- the child widgetx
- the horizontal position to move the widget toy
- the vertical position to move the widget to
-
put
Adds a widget to a `GtkFixed` at the given position.- Parameters:
widget
- the widget to addx
- the horizontal position to place the widget aty
- the vertical position to place the widget at
-
remove
Removes a child from @fixed.- Parameters:
widget
- the child widget to remove
-
setChildTransform
Sets the transformation for @widget.
This is a convenience function that retrieves the
[class@Gtk.FixedLayoutChild] instance associated to
@widget and calls [method@Gtk.FixedLayoutChild.set_transform].- Parameters:
widget
- a `GtkWidget`, child of @fixedtransform
- the transformation assigned to @widget to reset @widget's transform
-
asAccessible
Implements interfaceAccessible
. Call this to get access to interface functions.- Overrides:
asAccessible
in classWidget
- Returns:
Accessible
-
asBuildable
Implements interfaceBuildable
. Call this to get access to interface functions.- Overrides:
asBuildable
in classWidget
- Returns:
Buildable
-
asConstraintTarget
Implements interfaceConstraintTarget
. Call this to get access to interface functions.- Overrides:
asConstraintTarget
in classWidget
- Returns:
ConstraintTarget
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-