Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
Package | display | |
Module | widgets |
include "gchooser.g"
This tool generates a Tk widget for choosing items interactively. The
items must be associated with x, y coordinates, and a label. The items
are plotted using the pgplotter, and the user is
allowed to select items by left-clicking or to deselect items by
right-clicking. The plot frame may also be printed as a postscript
file or saved as an AIPS++ plot file.
An example of the use of gchooser is given in figure
1.12.
The constructor returns a subsequence with functions:
The events are:
The selection works as follows:
Description
An example of a graphical chooser. Selected items are in green.
Example
include 'gchooser.g'
include 'table.g'
t:=table('3C273XC1.ms/ANTENNA');
position := t.getcol('POSITION');
labels := t.getcol('NAME');
indices := t.getcol('ANTENNA_ID')+1;
t.done();
x := position[2,];
y := -position[1,];
gc := gchooser(labels=labels, indices=indices, x=x, y=y, autoref=T,
plottitle='Antenna locations',
width=500, height=500);
whenever gc->values do {
print "Values are ", $value;
}
whenever gc->select do {
print "Selected ", $value
}
whenever gc->deselect do {
print "Deselected ", $value
}
-
Selected 4
Selected 28
Selected 11
Selected 26
Selected 17
Selected 15
Selected 18
Selected 24
Values are [selection=[4 11 15 17 18 24 26 28] , labels=VLA:W6 VLA:OUT
VLA:N2 VLA:N4 VLA:E4 VLA:E6 VLA:E2 VLA:W2, x=[-207.86 37.1272 32.3322
25.3736 170.777 304.882 77.7937 0] , y=[-78.7424 14.7828 44.846
89.6066 -20.8221 -55.868 3.48509 0] ]
Next: gchooser - Constructor
Up: widgets - Module
Previous: fontchooserwidget - Constructor
  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