package stk
Install
Dune Dependency
Authors
Maintainers
Sources
md5=4a7d5aeecb002fa711a6eb002a544713
sha512=f2efc05917d5916980a8d09426b629028a748c00c19667b0bf4e0cf0c8811d80b5a693b95f662301bfbe3162cefd73e7f02e98cb5c1020876cbcf9fc81930434
doc/stk/Stk/Layers/class-layers/index.html
Class Layers.layers
Source
A layers
widget can handle several widget trees, allowing multiple layers of widgets. A layer is identified by its position. Bottom layer has position 0
. A layer can have a root widget associated (see the pack
method). Widgets (and so, layers) are rendered from bottom layer up to top layer, in this order.
inherit Stk.Container.container
Properties
method event_direction : event_direction
method set_event_direction : ?delay:float ->
?propagate:bool ->
event_direction ->
unit
Children widgets
method children : Stk.Container.child option list
Return the list of children widgets, from bottom layer to top layer. Layers with no widget are present with None
.
method children_widgets : Stk.Widget.widget list
Return the list of children widgets, i.e. the root widget of each layer, for layers which have one.
method widget_layer : Stk.Widget.widget -> int option
Return the layer of the given widget. The widget must be the root widget of the layer. If the widget is not found, None
is returned.
Box.ng/unpacking
method unpack_widget : Stk.Widget.widget -> unit
#unpack_widget w
removes the root widget w
, setting root widget for the corresponding layer to None
. If the widget is not found, do nothing.
method pack : ?layer:int ->
?opacity:float ->
?data:Stk.Container.child_data ->
Stk.Widget.widget ->
unit
#pack w
packs widget w
as root layer. Optional arguments are:
layer
: if specified, usew
as new root widget for this layer, eventually removing previous widget. If it is not specified, pack the widget as root for the first layer without root widget, eventually adding a layer to do so.opacity
setsProps.opacity
property ofw
.data
associates the given value tow
(inContainer.child
structure).
Operations on layers
#move_layer layer target
moves layer according to target
, which can have the following values:
`Bottom
: moves layer at the bottom of all layers,`Down n
: moves layern
positions down (or to the bottom iflayer <= n
),`Up n
: moves layern
positions up (or to the top iflayer + n >= number of layers
),`Top
: moves layer at the top of all layers.
The method returns the new position of the layer, if it changed. Remember that a layer is only identified by its position. So the returned value is the same layer, with the same root widget.