package bogue

  1. Overview
  2. Docs

Drop-down select list

It's the usual select box which opens a drop-down list when clicked on, similar to the <select> html tag.

Dependency graph

type t

Under the hood, a Select.t is a special type of menu with a single entry having a submenu.

val create : ?dst:Layout.t -> ?name:string -> ?action:(int -> unit) -> ?fg:Draw.color -> ?hmargin:int -> string array -> int -> t

For instance create [| "A"; "B"; "C" |] 1 will create a select box with default choice "B". The action (if specified) takes as argument the index of the selected item.

val layout : t -> Layout.t

The layout to display the select list.

val selected : t -> int

The index (starting from 0) of the selected item.

val set_label : t -> string -> unit

Modify the label.

val set_action : t -> (int -> unit) -> unit

Modify the action.

OCaml

Innovation. Community. Security.