Module Bogue.Table

module Table: sig .. end

Tables with sortable columns and selectable rows.

Dependency graph

type column = {
   title : string;
   length : int; (*

number of entries in the column.

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

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

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

*)
   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 Table.of_array or Table.of_list.

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.

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.