#!/bin/sh
# \
        exec itkwish -f "$0" ${1+"$@"} 

#
# Demo script for the Combobox class
#

frame .f1 -relief sunken
frame .f2
pack [label .f1.l -text "DropDown Comboboxes"] -fill x 
pack [frame .f1.s -height 6] -fill x
pack [label .f2.l -text "Simple ComboBox"] -fill x
pack [frame .f2.s -height 6] -fill x

# non-editable dropdown combo 
pack [Combobox .f1.cb1 -labeltext Month: -editable false -listheight 185 \
	  -items {Jan Feb Mar Apr May June Jul Aug Sept Oct Nov Dec}] \
    -padx 10 -pady 10 -fill x 

# editable dropdown 
pack [Combobox .f1.cb2 -fliparrow true -popupcursor hand1] \
    -padx 10 -pady 10 -fill x 
.f1.cb2 configure -items {Linux HP-UX SunOS Solaris Irix} -listheight 100 \
	-labeltext "OS choice:" \
	-selectioncommand {puts "Selected: [.f1.cb2 getcurselection]"}

# empty editable dropdown
pack [Combobox .f1.cb3 -unique true] -padx 10 -pady 10 -anchor w
.f1.cb3 configure -labelpos nw -labeltext "Numeric Combo:" -validate numeric

# simple combobox
pack [Combobox .f2.cb -dropdown false -textfont 9x15 \
	-labelpos nw -labeltext "Font:" -listheight 220 \
	  -selectioncommand {.f1.cb1 configure -textfont [.f2.cb getcurselection]} ] \
    -padx 10 -fill both -expand yes

# exit button
pack [button .f1.b -text "Quit" -command exit] -padx 10 -pady 10 -fill x

# pack the frames
pack .f1 -side left -fill x -anchor n
pack .f2 -side left -fill both -expand yes
update

# add simple combo items - do this last so demo starts a little quicker
set x [exec xlsfonts]
.f2.cb configure -items $x

