package stk

  1. Overview
  2. Docs
SDL-based GUI toolkit

Install

Dune Dependency

Authors

Maintainers

Sources

ocaml-stk-0.3.0.tar.bz2
md5=bf3724827aa00f2b5072a9f5e5e9293f
sha512=c7804040165317533b1bbaa6a23374a0bce5ba6976a2f48b49c90aa43c510b03134a1b2c353485365f4dd0cee8cb72d7fbe7558ee52e758db886771e262262d8

doc/stk/Stk/Flex/class-flex/index.html

Class Flex.flexSource

Container widget behaving like CSS flex box. The widget has class "vertical" or "horizontal" depending on orientation.

Properties

method inter_space : int
method set_inter_space : ?delay:float -> ?propagate:bool -> int -> unit
method justification : justification
method set_justification : ?delay:float -> ?propagate:bool -> justification -> unit
method items_alignment : items_alignment
method set_items_alignment : ?delay:float -> ?propagate:bool -> items_alignment -> unit
method content_alignment : content_alignment
method set_content_alignment : ?delay:float -> ?propagate:bool -> content_alignment -> unit
method wrap : bool
method set_wrap : ?delay:float -> ?propagate:bool -> bool -> unit
method wrap_on_break : bool
method set_wrap_on_break : ?delay:float -> ?propagate:bool -> bool -> unit
method collapse_spaces : bool
method set_collapse_spaces : ?delay:float -> ?propagate:bool -> bool -> unit

Accessing children

method widget_data : Stk.Widget.widget -> 'a option option

f#widget_data w returns the wdata associated the given widget w, or None if w is not a child of f.

method widget_index : Stk.Widget.widget -> int option

f#widget_index w returns the 0-based position of w in the children, or None if w is not a child of f.

method children_widgets : Stk.Widget.widget list

f#children_widgets returns the list of children widgets.

method reorder_child : Stk.Widget.widget -> int -> unit

f#reorder_child w pos moves w to pos in the children list. Does nothing if w is not a child of f.

Packing/unpacking widgets

method pack : ?pos:int -> ?data:'a -> ?kind:item_kind -> Stk.Widget.widget -> unit

f#pack w adds w to the children of f if it is not yet a child of f. Optional arguments are:

  • pos indicate the 0-based position to insert w. Default is to append w after all children.
  • data associates the given data to w.
  • kind specifies how w must be considered when arranging elements. Default is not to specify any kind, so that this property for this widget has default value (see Flex.item_kind).
method pack_space : ?props:Stk.Props.t -> ?wdata:Stk.Widget.wdata -> ?pos:int -> ?data:'a -> unit -> space

f#pack_space () creates a Flex.space widget and packs it. See flex.pack for arguments. Returns the created widget.

method pack_break : ?props:Stk.Props.t -> ?wdata:Stk.Widget.wdata -> ?pos:int -> ?data:'a -> unit -> space

f#pack_break () creates a Flex.space widget with `Break item kind and packs it. See flex.pack for arguments. Returns the created widget.

method unpack : Stk.Widget.widget -> unit

f#unpack w removes w from children. Does nothing if w is not a child of f.

method unpack_all : destroy:bool -> unit

f#unpack_all ~destroy removes all children from f. destroy indicates whether the destroy method must be called on each child after unpacking.

OCaml

Innovation. Community. Security.