NAME
swaplist - A dialog which allows a user to move options between two
listsSYNOPSIS
package require TTccll 88..44 package require TTkk 88..44 package require sswwaapplliisstt ??00..11?? ::::sswwaapplliisstt::::sswwaapplliisstt pathName variable completeList selectedList ?options?DESCRIPTION
This package provides a dialog which consists of 2 listboxes, along with buttons to move items between them and reorder the right list. ::::sswwaapplliisstt::::sswwaapplliisstt pathName variable completeList selectedList ?options?Creates a dialog which presents the user with a pair of list-
boxes. Items are selected by using the buttons to move them to the right list. The contents of the right list are put in the variable upon closure of the dialog. The command returns aboolean indicating if the user pressed OK or not. If -geometry
is not specified, the dialog is centered in its parent toplevel unless its parent is . in which case the dialog is centered in the screen. Options:-eemmbbeedd if this flag is supplied, the procedure will create a
swaplist widget named pathName, with the variable set as the
listvariable for the right side listbox. This flag willalso cause the -title and -geometry flags to be ignored.
-rreeoorrddeerr boolean specifying if buttons allowing the user to
change the order of the right listbox should appear or not. defaults to true-ttiittllee sets the title of the dialog window. defaults to "Config-
uration"-llllaabbeell sets the heading above the left list. defaults to
"Available:"-rrllaabbeell sets the heading above the right list. defaults to
"Selected:"-llbbuuttttoonntteexxtt sets the text on the "move left" button. defaults
to "<<"-rrbbuuttttoonntteexxtt sets the text on the "move right" button. defaults
to ">>"-uubbuuttttoonntteexxtt sets the text on the "move up" button. defaults to
"Move Up"-ddbbuuttttoonntteexxtt sets the text on the "move down" button. defaults
to "Move Down"-ggeeoommeettrryy sets the geometry of the dialog window. screen.
EEXXAAMMPPLLEEpackage require swaplist
namespace import swaplist::*
if {[swaplist .slist opts "1 2 3 4 5 6 7 8 9" "1 3 5"]} {
puts "user chose numbers: $ops"
} KKEEYYWWOORRDDSS dialog, disjointlistbox, listboxswaplist 0.1 swaplist(n)