module Table:sig
..end
Tables with sortable columns and selectable rows.
type
column = {
|
title : |
|||
|
length : |
(* | number of entries in the column. | *) |
|
rows : |
(* |
| *) |
|
compare : |
(* | if a compare function is provided, then the column will be dynamically
sortable by the user. | *) |
|
min_width : |
(* | 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
.
Tvar
. The Tvar can be used to see which rows were
selected by the user, and also to modify the selection if needed.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.