Description
The synclistboxes widget is a collection of scrolllistboxes which
are synchronized so that a selection in one is mirrored in all of
the other listboxes and the vertical scrollbar controls all of
the listboxes in the widget.
The synclistboxes widget supports all scrolllistbox widget events.
However, in order to allow for fine control over the individual
listboxes, many of the events have an optional additional
argument which specifies the listbox which will receive that
event. Each event is described below as a function due to the
current limitations of the documentation system. There is
only one actual function associated with this widget - listbox.
Direct access to the underlying listboxes is provided by the listbox
function. This is necessary in order to support popup help on
synclistboxeses. Popup help uses the tlead argument in constructing
the outframe. The value of that argument needs to be one of the
underlying widgets hence the need to return a reference to a true
listbox. Care should be taken
in using this as it allows the user to destroy the underlying listboxes
and get them momentarily out of sync.
Example
include 'synclistboxes.g'
f := frame()
# two syncronized listboxes filled from left to right inside f
# the packing order is determined by the optional "side" argument
# to the synclistboxes function. The listbox labels will be
# "Numbers" and "Colors".
slb := synclistboxes(f,2,"Numbers Colors");
# insert some values into the listboxes. An equal number of values
# must be inserted into each listbox with each use of insert.
somevals := array(' ',2,9);
somevals[1,] := "one two three four five six seven eight nine";
somevals[2,] := "red orange yellow lightgrey blue brown peach mauve gold";
slb->insert(somevals);
# you decide you don't want the horizontal scrollbars
slb->hscrollbar(F)
# and you would like that listbox to only be 8 characters wide
slb->width(8, 1)
# you decide you don't want the widget to always show the end
# after each insert event
slb->seeoninsert(F)
# you want to get the current selection(s), if any
s := slb->selection();
# and you want to get all of the values at that selection
g := slb->get(s);
# g[1] will have the value from the first listbox at index s
# g[2] will have the value from the second listbox at index s
Next: synclistboxes - Constructor
Up: widgets - Module
Previous: selectablelist.setwidth - Function
 
Contents
 
Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc.,
Washington, D.C.
Return to AIPS++ Home Page
2006-10-15