package stk

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

Class Table.tableSource

A widget containing widgets in a fixed number of rows and columns. It specialises Container.container to store children widgets in arrays.

Properties

method column_inter_padding : int
method set_column_inter_padding : ?delay:float -> ?propagate:bool -> int -> unit
method row_inter_padding : int
method set_row_inter_padding : ?delay:float -> ?propagate:bool -> int -> unit
method rows : int
method columns : int
method set_rows : int -> unit

table#set_rows n resizes table, changing only number of rows.

method set_columns : int -> unit

table#set_columns n resizes table, changing only number of columns.

method resize : rows:int -> columns:int -> unit

resize ~rows ~columns resizes table. No need to repack widgets remaining in the new range of rows and columns. Other widgets are unpacked.

Children

method children : child option array array
method children_widgets : Stk.Widget.widget option array array
method widget_at : row:int -> column:int -> Stk.Widget.widget option
method child_at : row:int -> column:int -> child option
method widget_pos : Stk.Widget.widget -> position option
method pack : ?pos:position -> ?row_span:int -> ?column_span:int -> ?hexpand:int -> ?vexpand:int -> ?hfill:bool -> ?vfill:bool -> ?data:Stk.Container.child_data -> Stk.Widget.widget -> unit

o#pack w adds widget w to o. Optional parameters are:

  • pos, a pair (row,column) indicates a position to insert w; default is to pack w to the first empty table cell.
  • hexpand (resp. vexpand) sets Props.hexpand (resp. Props.vexpand) property of w to the given value.
  • hfill (resp. vfill) sets Props.hfill (resp. Props.vfill) property of w to the given value.
  • row_span (resp. column_span) sets row_span (resp. column_span properties of w to the given value. Default is to set to 1.
  • data associates the given value to w. All data associated to children must have the same type (this type is the type parameter of class table.

To allocate space for table cells, the same algorithm as in Box.box.pack is applied, but handling both horizontal and vertical sizes and expand values of each widget.

method unpack : Stk.Widget.widget -> unit

o#unpack w removes child widget w from o.

method unpack_at : destroy:bool -> row:int -> column:int -> unit

o#unpack_at ~row ~columns removes child widget w at given position, if any. destroy indicates whether to call #destroy on children after removing.

method unpack_all : destroy:bool -> unit

o#unpack_all ~destroy removes all children from o. destroy indicates whether to call #destroy on children after removing.

OCaml

Innovation. Community. Security.