| Itcl  | Itk  | Itcl @ Wiki  | Itcl @ SF  | Tcl  | Tcl @ Wiki |
  home || iwidgets || man pages cross ref distribution docs faq  
buttonbox
calendar
canvasprintbox
canvasprintdialog
checkbox
combobox
dateentry
datefield
dialog
dialogshell
disjointlistbox
entryfield
extbutton
extfileselectionbox
extfileselectiondialog
feedback
fileselectionbox
fileselectiondialog
finddialog
hierarchy
hyperhelp
labeledframe
labeledwidget
mainwindow
menubar
messagebox
messagedialog
notebook
optionmenu
panedwindow
promptdialog
pushbutton
radiobox
regexpfield
scrolledcanvas
scrolledframe
scrolledhtml
scrolledlistbox
scrolledtext
scrolledwidget
selectionbox
selectiondialog
shell
spindate
spinint
spinner
spintime
tabnotebook
tabset
timeentry
timefield
toolbar
watch

man page | options | methods

Disjointlistbox

The disjointlistbox iwidget provides the user with 2 scrolledlistboxes, that allows the user to pass items from one listbox to the other. This is commonly used when the user needs to select multiple items that are a subset of another list. The listbox buttons can be placed between or below the listboxes. Each listbox has a running count of the number of items within its listbox. Their are various methods that work on each of the listboxes, and most methods come in pairs that operate on one listbox and are distinguished by lhs or rhs, denoting left hand side and right hand side respectively. Hence, to access one of the listboxes, the user would append lhs or rhs, depending on the side. So, an insert operation would become insertlhs and insertrhs. There is also a more generic method that allows access to the scrolledlistbox methods using lhs and rhs methods. Using these methods, the user can access directly each scrolledlistbox. When the user clicks in either listbox, then the button associated with the other listbox with become inactive. For further information, see the Disjointlistbox manpage

Components: hull lhs lhsbutton lhsCount rhs rhsbutton rhsCount
				

wm title . "Disjointlistbox Example"

##=========================================================
##	Create a disjointlistbox iwidget
##=========================================================
##
iwidgets::disjointlistbox .dj \
  -buttonplacement center \
  -lhslabeltext "Grocery Items" \
  -rhslabeltext "Grocery List" \
  -lhsbuttonlabel "Add Grocery Item" \
  -rhsbuttonlabel "Remove Grocery Item"

pack .dj \
  -fill both \
  -expand true


##
##	Populate both fields, using 2 different methods
##
.dj setlhs [list bananas apples juice milk bread eggs beer]
.dj insertrhs [list fish salsa]

##
##	Make an initial selection in the
##	lhs listbox
##
.dj lhs selection set 2 3

Download this sample code
man page | options | methods
 
  home || iwidgets || man pages cross ref distribution docs faq  
Copyright | Contributions | Development Team | Credits
Bugs/Comments/Suggestions about this web site