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


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


selectablelist - Tool



Package display
Module widgets


Postscript file available

Tk widget for selection from a menu or a listbox depending on list length

include "selectablelist.g"

Constructors
selectablelist Construct a selectablelist
Functions
disabled Disable or enable the widget
done Destroy ourselves
replace Replace the menu with the provided items
setbackground Set the color of the background of the button
setforeground Set the color of the foreground of the button
setlabel Set the label of the button
setwidth Set the width of the selection button



Description

This Tk widget enables you to select from a list of items. Depending on the length of the list, either a menu or a scrollable listbox is used for the selection. This is useful because for very long lists, you don't want a menu.

If a menu is created, then the button that this widget makes is just a normal menu button. If a listbox is made, then the button is just a plain button. When you press it, the listbox is created close to the button.

With the listbox, there is an associated entry box into which you can type, and the the list is searched and the match highlighted as you type. If you hit carriage return, then the selection is made. Alternatively you could click on the highlighted entry.

Whenever a selection is made, this widget emits an event called select. T $value of this event is a record with two fields. Field ``item'' contains the name of the selected item. Field ``index'' conatain the index of the selected item from the constructor list.

The widget accepts an event called setwidth. It is the same as calling the setwidth tool function.

An example of the operation of this widget can be viewed in the measures GUI (start with dm.gui()), and goto e.g. Frame -> Which direction -> Source.




next up previous contents index
Next: selectablelist - Constructor Up: widgets - Module Previous: scrolltext.vscrollbar - 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