package stk

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Stk.ButtonSource

Buttons.

Sourceval active : bool Props.prop

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

Simple buttons

Sourceclass button : ?classes:string list option -> ?name:string option -> ?props:Props.t option -> ?wdata: Widget.wdata option -> unit -> object ... end

Simple button.

Sourcetype Widget.widget_type +=
  1. | Button of button
Sourceval button : ?classes:string list -> ?name:string -> ?props:Props.t -> ?wdata:Widget.wdata -> ?pack:(Widget.widget -> unit) -> unit -> button

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

Sourceval text_button : ?classes:string list -> ?label_classes:string list -> ?name:string -> ?props:Props.t -> ?wdata:Widget.wdata -> ?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. label_class is passed as ?class_ argument when creating label. See Widget arguments for other arguments.

Toggle buttons

Sourceclass togglebutton : ?classes:string list option -> ?name:string option -> ?props:Props.t option -> ?wdata: Widget.wdata option -> unit -> object ... end

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

Sourcetype Widget.widget_type +=
  1. | Togglebutton of togglebutton
Sourceval togglebutton : ?classes:string list -> ?name:string -> ?props:Props.t -> ?wdata:Widget.wdata -> ?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.

Sourceval text_togglebutton : ?classes:string list -> ?label_classes:string list -> ?name:string -> ?props:Props.t -> ?wdata:Widget.wdata -> ?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. label_class is passed as ?class_ argument when creating label. See Widget arguments for other arguments.

Check and radio buttons

Sourceclass 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).

Sourceval 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.

Sourceval check_indicator_font : Font.font_desc Props.prop
Sourceval css_check_indicator_font : Font.font_desc Css.P.prop
Sourceval check_indicator_active_char : Uchar.t Props.prop
Sourceval css_check_indicator_active_char : Uchar.t Css.P.prop
Sourceval check_indicator_inactive_char : Uchar.t Props.prop
Sourceval css_check_indicator_inactive_char : Uchar.t Css.P.prop
Sourceclass checkbutton : ?classes:string list option -> ?name:string option -> ?props:Props.t option -> ?wdata: Widget.wdata option -> unit -> object ... end

The checkbutton widget.

Sourcetype Widget.widget_type +=
  1. | Checkbutton of checkbutton
Sourceval checkbutton : ?classes:string list -> ?name:string -> ?props:Props.t -> ?wdata:Widget.wdata -> ?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.

Sourceval radiobutton : ?classes:string list -> ?name:string -> ?props:Props.t -> ?wdata:Widget.wdata -> ?group:group -> ?active:bool -> ?pack:(Widget.widget -> unit) -> unit -> checkbutton

Convenient function to create a checkbutton acting as a radio button (with class "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.

Sourceval text_checkbutton : ?classes:string list -> ?label_classes:string list -> ?name:string -> ?props:Props.t -> ?wdata:Widget.wdata -> ?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. label_classes is passed as ?classes argument when creating label. See Widget arguments for other arguments.

Sourceval text_radiobutton : ?classes:string list -> ?label_classes:string list -> ?name:string -> ?props:Props.t -> ?wdata:Widget.wdata -> ?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 (with class "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. label_classes is passed as ?classes argument when creating label. See Widget arguments for other arguments.

OCaml

Innovation. Community. Security.