package bogue

  1. Overview
  2. Docs

Tables with sortable columns and selectable rows.

Dependency graph
type column = {
  1. title : string;
  2. length : int;
    (*

    number of entries in the column.

    *)
  3. rows : int -> Layout.t;
    (*

    row i should return the Layout corresponding to the ieth entry of that column.

    *)
  4. compare : (int -> int -> int) option;
    (*

    if a compare function is provided, then the column will be dynamically sortable by the user. compare i1 i2 > 0 means that entry i1 is larger than entry i2.

    *)
  5. min_width : int option;
    (*

    pixel width of the column. If not specified, the max width of entries will be used.

    *)
}
type t
val create : ?w:int -> h:int -> ?row_height:int -> ?name:string -> column list -> Layout.t * (Selection.t, Selection.t) Tvar.t

Create a table by specifying its list of columns; in each column, the entries can be arbitrary layouts. If entries are simple text labels, it's easier to use the helper functions of_array or of_list.

  • returns

    a layout and a Tvar. The Tvar can be used to see which rows were selected by the user, and also to modify the selection if needed.

  • see example 35

    .

val of_array : ?w:int -> h:int -> ?widths:int option list -> ?row_height:int -> ?name:string -> string list -> string array array -> Layout.t * (Selection.t, Selection.t) Tvar.t

Create a table from an array of rows, each row being a string array.

  • see example 35bis

    .

val of_list : ?w:int -> h:int -> ?widths:int option list -> ?row_height:int -> ?name:string -> string list list -> Layout.t * (Selection.t, Selection.t) Tvar.t

Create a table from a list of rows, each row being a string list.

  • see example 35ter

    .

OCaml

Innovation. Community. Security.