module BasicList where
import Tcl

basicList =
     do	
	w <- window []

	l  <- label w [text msg, justify LeftJ,
		       "wraplength" %% "4i"]
	f1 <- frame w []
	lb <- listbox w [height 12, setgrid True]
	vs <- vscroll lb []
	resetListbox lb counties

	packAdd f1 [packV,expand True,fillY,packPadY 10]
        packAdd lb [packH,fillXY,expand True,inFrame f1]
        packAdd vs [packH,fillY,inFrame f1]

	packAdd l [packV]
	return ()



msg = "A listbox containing the 32 counties of Ireland is displayed below, along with a scrollbar.  You can scan the list either using the scrollbar or by scanning.  To scan, press button 2 in the widget and drag up or down."


counties = 
	["Antrim"
	,"Armagh" 
	,"Carlow"
	,"Cavan"
	,"Clare"
	,"Cork"
	,"Derry" 
	,"Donegal"
	,"Down"  
	,"Dublin"
	,"Fermanagh" 
	,"Galway"
	,"Kerry"
	,"Kildare"
	,"Killkenny"
	,"Laois"
	,"Leitrim"
	,"Limerick"
	,"Longford"
	,"Louth"
	,"Mayo"
	,"Meath"
	,"Monaghan" 
	,"Offaly"
	,"Roscommon"
	,"Sligo"
	,"Tipperary"
	,"Tyrone"    
	,"Waterford"
	,"Westmeath"
	,"Wexford"
	,"Wicklow"
	]
	
