;******************************************************************************
;
; File name    : mkListbox.stk
; Creation     : Jul-29-1993
; Modification : Jul-29-1993
;
;******************************************************************************
;
; STk adaptation of the Tk widget demo.
;
; mkListbox:
; Create a top-level window that displays a listbox with the names of the
; 50 states.
;
;******************************************************************************

(provide "mkListbox")

(define (mkListbox)
  (catch (destroy .top-listbox))
  (toplevel ".top-listbox")
  (dpos .top-listbox)
  (wm 'title .top-listbox "Listbox Demonstration (50 states)")
  (wm 'iconname .top-listbox "Listbox")
  (wm 'minsize .top-listbox 1 1)

  (message ".top-listbox.m"
	   :font "-Adobe-times-medium-r-normal--*-180*"
	   :aspect 300
	   :text "A listbox containing the 50 states is displayed below, along with a scrollbar.  You can scan the list either using the scrollbar or by dragging in the listbox window with <Shift> key and button 2 pressed.\n\nClick the \"OK\" button when you've seen enough.")
  (frame ".top-listbox.f" :borderwidth 10)
  (button ".top-listbox.ok" :text "OK" :command '(destroy .top-listbox))
  (pack .top-listbox.m :side "top")
  (pack .top-listbox.f :side "top" :expand "yes" :fill "y")
  (pack .top-listbox.ok :side "bottom" :fill "x")

  (scrollbar ".top-listbox.f.s" 
	     :relief "sunken" :command ".top-listbox.f.l 'yview")
  (listbox ".top-listbox.f.l"
	   :yscroll ".top-listbox.f.s 'set"
	   :relief "sunken" :setgrid 1)
  (pack .top-listbox.f.s :side "right" :fill "y")
  (pack .top-listbox.f.l :side "left" :expand "yes" :fill "both")
  (.top-listbox.f.l 'insert 0 "Alabama" "Alaska" "Arizona" "Arkansas"
		   "California" "Colorado" "Connecticut" "Delaware" "Florida"
		   "Georgia" "Hawaii" "Idaho" "Illinois" "Indiana" "Iowa"
		   "Kansas" "Kentucky" "Louisiana" "Maine" "Maryland"
		   "Massachusetts" "Michigan" "Minnesota" "Mississippi" 
		   "Missouri" "Montana" "Nebraska" "Nevada" "New Hampshire"
		   "New Jersey" "New Mexico" "New York" "North Carolina"
		   "North Dakota" "Ohio" "Oklahoma" "Oregon" "Pennsylvania"
		   "Rhode Island" "South Carolina" "South Dakota" "Tennessee" 
		   "Texas" "Utah" "Vermont" "Virginia" "Washington"
		   "West Virginia" "Wisconsin" "Wyoming"))
