package stk

  1. Overview
  2. Docs

Buttons.

val active : bool Props.prop

Property used to indicate whether a toggle or option button is activate.

Simple buttons

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

Simple button.

val button : ?class_:string -> ?name:string -> ?props:Props.t -> ?pack:(Widget.widget -> unit) -> unit -> button

Convenient function to create a button. See widget_arguments for arguments.

val text_button : ?class_:string -> ?name:string -> ?props:Props.t -> ?text:string -> ?pack:(Widget.widget -> unit) -> unit -> button * Text.label

Convenient function to create a button with a Text.label as child. text optional argument is passed to Text.label. See widget_arguments for other arguments.

Toggle buttons

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

A toggle button. State is represented by the active property. Activating the widget toggles the state.

val togglebutton : ?class_:string -> ?name:string -> ?props:Props.t -> ?active:bool -> ?pack:(Widget.widget -> unit) -> unit -> togglebutton

Convenient function to create a togglebutton. Initial state can be specifier with the active argument (default is false). See widget_arguments for other arguments.

val text_togglebutton : ?class_:string -> ?name:string -> ?props:Props.t -> ?active:bool -> ?text:string -> ?pack:(Widget.widget -> unit) -> unit -> togglebutton * Text.label

Convenient function to create a togglebutton with a Text.label as child. Initial state can be specifier with the active argument (default is false). text optional argument is passed to Text.label. See widget_arguments for other arguments.

Check and radio buttons

class group : object ... end

A group is used to share a state among several checkbuttons, so they act as radio buttons (only one can be active at the same time).

val group : unit -> group

Convenient function to create a group.

The following properties are used to tune the appearance of checkbuttons: a font and active and inactive characters.

val check_indicator_font : Font.font_desc Props.prop
val check_indicator_active_char : Uchar.t Props.prop
val check_indicator_inactive_char : Uchar.t Props.prop
class checkbutton : ?class_:string option -> ?name:string option -> ?props:Props.t option -> unit -> object ... end

The checkbutton widget.

val checkbutton : ?class_:string -> ?name:string -> ?props:Props.t -> ?group:group -> ?active:bool -> ?pack:(Widget.widget -> unit) -> unit -> checkbutton

Convenient function to create a checkbutton. Initial state can be specifier with the active argument (default is false). See widget_arguments for other arguments.

val radiobutton : ?class_:string -> ?name:string -> ?props:Props.t -> ?group:group -> ?active:bool -> ?pack:(Widget.widget -> unit) -> unit -> checkbutton

Convenient function to create a checkbutton acting as a radio button (default class_ is "radiobutton"). Initial state can be specifier with the active argument (default is false). group can be used to set the group the radio button belongs to. See widget_arguments for other arguments.

val text_checkbutton : ?class_:string -> ?name:string -> ?props:Props.t -> ?group:group -> ?active:bool -> ?text:string -> ?pack:(Widget.widget -> unit) -> unit -> checkbutton * Text.label

Convenient function to create a checkbutton with a Text.label as child. Initial state can be specifier with the active argument (default is false). text optional argument is passed to Text.label. See widget_arguments for other arguments.

val text_radiobutton : ?class_:string -> ?name:string -> ?props:Props.t -> ?group:group -> ?active:bool -> ?text:string -> ?pack:(Widget.widget -> unit) -> unit -> checkbutton * Text.label

Convenient function to create a checkbutton acting as a radio button (default class_ is "radiobutton") with a Text.label as child. Initial state can be specifier with the active argument (default is false). group can be used to set the group the radio button belongs to. text optional argument is passed to Text.label. See widget_arguments for other arguments.

OCaml

Innovation. Community. Security.