package stk

  1. Overview
  2. Docs

Boxes to pack widgets.

val inter_padding : int Props.prop

Property "inter_padding" use to specify a space between packed children. Default is 0.

Stacking boxes

class 'a box : ?class_:string option -> ?name:string option -> ?props:Props.t option -> unit -> object ... end

A box is a Container.container which stacks its children, giving each one more or less space according to its size and properties. Widgets can be stacked horizontally or vertically (depending on the Props.orientation property).

val box : orientation:Props.orientation -> ?class_:string -> ?name:string -> ?props:Props.t -> ?pack:(Widget.widget -> unit) -> unit -> 'a box

Convenient function to create a box. The class_ argument defaults to "vbox" if orientation is Vertical or "hbox" if orientation is Horizontal. See widget_arguments for other arguments.

val hbox : ?class_:string -> ?name:string -> ?props:Props.t -> ?pack:(Widget.widget -> unit) -> unit -> 'a box

Same as box but orientation is already fixed to Horizontal.

val vbox : ?class_:string -> ?name:string -> ?props:Props.t -> ?pack:(Widget.widget -> unit) -> unit -> 'a box

Same as box but orientation is already fixed to Vertical.

Paned widgets

type handle_position = [
  1. | `Percent of float
  2. | `Absolute of int
]

A handle position, defined either as percentage or absolute position.

val handle_position_wrapper : [ `Absolute of int | `Percent of float ] Ocf.Wrapper.t
val handle_positions : handle_position option list Props.prop

Property "handle_positions", to store the positions of the handles in a paned widget.

type user_handle_positionning = [
  1. | `Percent
  2. | `Absolute
]

How to define handle position when the user moves it: as percentage or absolute value. This changes the way handle positions are updated when the paned widget is resized: with `Percent, ratios between children will be kept, but with `Absolute the handles will remain at the same position.

val user_handle_positionning_wrapper : user_handle_positionning Ocf.wrapper
val user_handle_positionning : user_handle_positionning Props.prop

Property "user_handle_positionning".

val handle_props : Props.t Props.prop

Property "paned_handle_props" to define appearance of handles in paned widget. Default set Props.width to 2 and Props.fg_color to Color.grey.

val user_set_handle_live_update : bool Props.prop

Property "paned_user_set_handle_live_update" defines whether to update paned widget on each move of a handle by user (true), or wait for the user to end moving the handle (false). Default is true. It may be useful to set it to false when computation of children sizes may take some time.

class paned : ?class_:string option -> ?name:string option -> ?props:Props.t option -> unit -> object ... end

Paned widget.

val paned : Props.orientation -> ?class_:string -> ?name:string -> ?user_set_handle_live_update:bool -> ?props:Props.t -> ?pack:(Widget.widget -> unit) -> unit -> paned
val hpaned : ?class_:string -> ?name:string -> ?user_set_handle_live_update:bool -> ?props:Props.t -> ?pack:(Widget.widget -> unit) -> unit -> paned
val vpaned : ?class_:string -> ?name:string -> ?user_set_handle_live_update:bool -> ?props:Props.t -> ?pack:(Widget.widget -> unit) -> unit -> paned