Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: synclistboxes - Constructor Up: widgets - Module Previous: selectablelist.setwidth - Function


synclistboxes - Tool



Package display
Module widgets


Postscript file available

A collection of synchronized scrolllistboxes.

include "synclistboxes.g"

Constructors
synclistboxes Construct a synclistboxes
Functions
background Set the background color.
bind bind an event to a glish event
borderwidth change the borderwidth(s)
clear clear the selection at the indicated items
delete delete the indicated items
done Destroy ourselves
exportselection export the selection to the X clipboard?
font change the text font
foreground Set the foreground color.
get request items, i.e. map indexes to items
height Set the height
hscrollbar Turn on or off the horizontal scrollbars
insert insert values into the listboxes
leadbox which listbox is the default returned by the listbox function
listbox Return an underlying listbox agent
mode change listbox mode
nearest return item nearest the y offset param
relief change the border relief
see scroll listboxes to specified index is visible
seeoninsert See the end after each insert?
select select the indicate items
selection get indexes of the current selection
vscrollbar Turn on or off the vertical scrollbar
width Set the width



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 up previous contents index
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