Package ch.bailu.gtk.gtk
Klasse LayoutManager
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.type.PropertyHolder
ch.bailu.gtk.gtk.LayoutManager
- Alle implementierten Schnittstellen:
PointerInterface
- Bekannte direkte Unterklassen:
BinLayout,BoxLayout,CenterLayout,ClampLayout,ConstraintLayout,CustomLayout,FixedLayout,GridLayout,OverlayLayout,WrapLayout
Handles the preferred size and allocation for children of a widget.
You typically subclass `GtkLayoutManager` if you want to implement a
layout policy for the children of a widget, or if you want to determine
the size of a widget depending on its contents.
Each `GtkWidget` can only have a `GtkLayoutManager` instance associated
to it at any given time; it is possible, though, to replace the layout
manager instance using [method@Gtk.Widget.set_layout_manager].
## Layout properties
A layout manager can expose properties for controlling the layout of
each child, by creating an object type derived from [class@Gtk.LayoutChild]
and installing the properties on it as normal `GObject` properties.
Each `GtkLayoutChild` instance storing the layout properties for a
specific child is created through the [method@Gtk.LayoutManager.get_layout_child]
method; a `GtkLayoutManager` controls the creation of its `GtkLayoutChild`
instances by overriding the GtkLayoutManagerClass.create_layout_child()
virtual function. The typical implementation should look like:
```c
static GtkLayoutChild *
create_layout_child (GtkLayoutManager *manager,
GtkWidget *container,
GtkWidget *child)
{
return g_object_new (your_layout_child_get_type (),
"layout-manager", manager,
"child-widget", child,
NULL);
}
```
The [property@Gtk.LayoutChild:layout-manager] and
[property@Gtk.LayoutChild:child-widget] properties
on the newly created `GtkLayoutChild` instance are mandatory. The
`GtkLayoutManager` will cache the newly created `GtkLayoutChild` instance
until the widget is removed from its parent, or the parent removes the
layout manager.
Each `GtkLayoutManager` instance creating a `GtkLayoutChild` should use
[method@Gtk.LayoutManager.get_layout_child] every time it needs to query
the layout properties; each `GtkLayoutChild` instance should call
[method@Gtk.LayoutManager.layout_changed] every time a property is
updated, in order to queue a new size measuring and allocation.
You typically subclass `GtkLayoutManager` if you want to implement a
layout policy for the children of a widget, or if you want to determine
the size of a widget depending on its contents.
Each `GtkWidget` can only have a `GtkLayoutManager` instance associated
to it at any given time; it is possible, though, to replace the layout
manager instance using [method@Gtk.Widget.set_layout_manager].
## Layout properties
A layout manager can expose properties for controlling the layout of
each child, by creating an object type derived from [class@Gtk.LayoutChild]
and installing the properties on it as normal `GObject` properties.
Each `GtkLayoutChild` instance storing the layout properties for a
specific child is created through the [method@Gtk.LayoutManager.get_layout_child]
method; a `GtkLayoutManager` controls the creation of its `GtkLayoutChild`
instances by overriding the GtkLayoutManagerClass.create_layout_child()
virtual function. The typical implementation should look like:
```c
static GtkLayoutChild *
create_layout_child (GtkLayoutManager *manager,
GtkWidget *container,
GtkWidget *child)
{
return g_object_new (your_layout_child_get_type (),
"layout-manager", manager,
"child-widget", child,
NULL);
}
```
The [property@Gtk.LayoutChild:layout-manager] and
[property@Gtk.LayoutChild:child-widget] properties
on the newly created `GtkLayoutChild` instance are mandatory. The
`GtkLayoutManager` will cache the newly created `GtkLayoutChild` instance
until the widget is removed from its parent, or the parent removes the
layout manager.
Each `GtkLayoutManager` instance creating a `GtkLayoutChild` should use
[method@Gtk.LayoutManager.get_layout_child] every time it needs to query
the layout properties; each `GtkLayoutChild` instance should call
[method@Gtk.LayoutManager.layout_changed] every time a property is
updated, in order to queue a new size measuring and allocation.
-
Verschachtelte Klassen - Übersicht
Von Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify -
Feldübersicht
Von Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidAssigns the given @width, @height, and @baseline to
a @widget, and computes the position and sizes of the children of
the @widget using the layout management policy of @manager.static ClassHandlerstatic intgetLayoutChild(Widget child) Retrieves a `GtkLayoutChild` instance for the `GtkLayoutManager`,
creating one if necessary.static longstatic TypeSystem.TypeSizeintRetrieves the request mode of @manager.static longstatic TypeSystem.TypeSizeRetrieves the `GtkWidget` using the given `GtkLayoutManager`.voidQueues a resize on the `GtkWidget` using @manager, if any.voidmeasure(Widget widget, int orientation, int for_size, Int minimum, Int natural, Int minimum_baseline, Int natural_baseline) Measures the size of the @widget using @manager, for the
given @orientation and size.Von 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
-
LayoutManager
-
-
Methodendetails
-
getClassHandler
-
allocate
Assigns the given @width, @height, and @baseline to
a @widget, and computes the position and sizes of the children of
the @widget using the layout management policy of @manager.- Parameter:
widget- the `GtkWidget` using @managerwidth- the new width of the @widgetheight- the new height of the @widgetbaseline- the baseline position of the @widget, or -1
-
getLayoutChild
Retrieves a `GtkLayoutChild` instance for the `GtkLayoutManager`,
creating one if necessary.
The @child widget must be a child of the widget using @manager.
The `GtkLayoutChild` instance is owned by the `GtkLayoutManager`,
and is guaranteed to exist as long as @child is a child of the
`GtkWidget` using the given `GtkLayoutManager`.- Parameter:
child- a `GtkWidget`- Gibt zurück:
- a `GtkLayoutChild`
-
getRequestMode
public int getRequestMode()Retrieves the request mode of @manager.- Gibt zurück:
- a `GtkSizeRequestMode`
-
getWidget
Retrieves the `GtkWidget` using the given `GtkLayoutManager`.- Gibt zurück:
- a `GtkWidget`
-
layoutChanged
public void layoutChanged()Queues a resize on the `GtkWidget` using @manager, if any.
This function should be called by subclasses of `GtkLayoutManager`
in response to changes to their layout management policies. -
measure
public void measure(@Nonnull Widget widget, int orientation, int for_size, @Nullable Int minimum, @Nullable Int natural, @Nullable Int minimum_baseline, @Nullable Int natural_baseline) Measures the size of the @widget using @manager, for the
given @orientation and size.
See the [class@Gtk.Widget] documentation on layout management for
more details.- Parameter:
widget- the `GtkWidget` using @managerorientation- the orientation to measurefor_size- Size for the opposite of @orientation; for instance, if the @orientation is %GTK_ORIENTATION_HORIZONTAL, this is the height of the widget; if the @orientation is %GTK_ORIENTATION_VERTICAL, this is the width of the widget. This allows to measure the height for the given width, and the width for the given height. Use -1 if the size is not knownminimum- the minimum size for the given size and orientationnatural- the natural, or preferred size for the given size and orientationminimum_baseline- the baseline position for the minimum sizenatural_baseline- the baseline position for the natural size
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-