<<<<<<<<<<<<<<<<<

ui_table(ui) HP Widgets ui_table(ui)

NAME

ui_table - 2D table based upon HP row/column widget

DESCRIPTION

The ui_table class provides a simple 2D table for LYMB script programmers.

SUPERCLASS

ui

INSTANCE VARIABLES

columns defines the number of columns the table will contain.

rows defines the number of rows the table will contain.

row indicates the currently active row for label: and label? messages.

column indicates the currently active column for label: and label? messages.

select_action is the name of a LYMB object that will receive a tick! message when a table element is selected. When the select_action is invoked, the row and column instance variables indicate the button that was selected.

MESSAGES

row[=+-?] set, increment, decrement, or query the current row value.

column[=+-?] set, increment, decrement, or query the current column value.

columns[=?] set or get the number of columns in the table.

rows[=?] set or get the number of rows in the table.

select_action[=?] set or get the select action object name.

EXAMPLES

-- the following LYMB script declares a 3 X 5 table that treats the -- first column and row as label fields. When a button in the main -- body of the table is selected, the number in it is decremented.

ui_table new: table;

logic new: test; string new: s; scalar new: num;

actions new: button_action; actions new: select_action;

select_action tick_actions=" s = + [table label?] + ; parser parse: s ; num - 1 ; s float_format= = num ; table label: s; " ;

button_action tick_actions=" test and: ([table row?],[table column?]) true: select_action tick!; ; " ;

table parent=ui rows=3 columns=5 -- set starting row & column row=0 column=0 -- define labels for row & column elements starting from -- current (row,col) label: (" ","O'Hare "," JFK "," Gatwick"," Orly ", "747" ,"6", "0", "4", "0", "A320","10", "20", "7", "10") select_action=button_action

create! ;

ui on! start!;

SEE ALSO

ui, ui_rowcol


Please send comments and suggestions to
consult@rpi.edu