A tab_stack object controls a set of tab objects, sheets holding controllers. Tab-stacks are normally used to make dialog windows with large numbers of options manageble.
The code below is a partial implementation of a dialog to specify a PC:
new(D, dialog('PC Specifiation sheet')),
send(D, gap, size(0,0)),
send(D, pen, 0),
send(D, append,
tab_stack(new(CPU, tab(cpu)),
new(Disk, tab(disk)),
new(Monitor, tab(monitor)),
...)),
send(CPU, append,
new(CPUT, menu(cpu, choice))),
send_list(CPUT, append, [386, 486, pentium]),
...
send(D, open).
->on_top.
Tabs may be added both before and after displaying a tab_stack. See
tab_stack->layout_dialog
for fixing the layout after adding to a displayed tab_stack.<-on_top
tab and recompute the layout of the tabs. See also device->erase.->append,
left to right.->layout_dialog
to force all member tab
objects to adjust themselves to the requested size.
If size is @default,
the system will invoke dialog_group->layout_dialog
to all its members and then compute the union of the member tab
objects to determine the required size. Next it will call this method
again with the computed size.
->event
method after the user clicks on the label. of a hidden tab
object.
Note that the argument may be the name of the tab rather than the tab itself.
<-status.