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


next up previous contents index
Next: listboxcontainer - Constructor Up: widgets - Module Previous: histogramgui.enable - Function


listboxcontainer - Tool



Package display
Module widgets


Postscript file available

A scrolllistbox with an underlying itemcontainer.

include "listboxcontainer.g"

Constructors
listboxcontainer Construct a listboxcontainer
Functions
clear (EVENT) clear selections
delete (EVENT) delete a name-value pair
done Destroy ourselves
fromforeign insert items from container or record
get (EVENT) return the value of the item specified
hasitem check if item is present in listboxcontainer
hscrollbar (EVENT) Turn on or off the horizontal scrollbar
insert (EVENT) Insert a name-value pair or record elements, or overwrite values of existing pairs
itemnames Get the names of all items.
see (EVENT) scroll to the specified item
seeoninsert (EVENT) See the end after each insert?
select (EVENT) make selection
selection (EVENT) return a record of items selected
vscrollbar (EVENT) Turn on or off the vertical scrollbar



Description

The listboxcontainer widget is a scrolllistbox widget. It has some similarity to the interface of the scrolllistbox widget. The difference to the original listbox and scrolllistbox is, that this widgets is a wrapper for an itemcontainer. Everything inserted into the widget is stored in an itemcontainer as a name-value pair (an item). The name is displayed in the widget. Items can be accessed by name or by index. One has to be careful if using indices, because the listboxcontainer is adjusting itself (eg. deleting an item pushes all other items up by 1). Another difference to the standard listbox and scrolllistbox is the indexing. Indices are integers not strings! Indexing starts at ``0'' as opposed to the itemcontainer, where indexing starts the ``Glish'' way at ``1''.

The listboxcontainer widget supports all scrolllistbox widget events. For the events ``background bind borderwidth exportselection font height hscrollbar mode relief seeoninsert view vscrollbar vscrollview width'' see the documentation on scrolllistbox and listbox.

All events which are emitted by the underlying listbox are forwarded and will be seen to be emitted by the listboxcontainer.

Note that most of the functions listed here are actually events.



Example
include 'listboxcontainer.g'   
f := frame()
lbc := listboxcontainer(f)
lbc->insert('x',1)
lbc->insert('y',2)
# you want to add a record
r := [a=111,b=222,c=333]
lbc->insert(r)
# you want to get the current selection(s), if any
s := lbc->selection();
#you want to delete 'x' and 'y' by name
lbc->delete('x','y')
#or by index
lbc->delete(0:1)
# to retrieve the value bound to name 'a'
a := l->get('a')




next up previous contents index
Next: listboxcontainer - Constructor Up: widgets - Module Previous: histogramgui.enable - 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