Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
set empty {}
set states {California Indiana Nevada}
array set cities {
California {{Los Angeles} Sacramento {San Francisco}}
Indiana {Indianapolis Loogootee {Terre Haute}}
Nevada {{Carson City} {Las Vegas} Reno}
}
listbox .lb1 -listvariable states
listbox .lb2 -listvariable empty
bind .lb1 <<ListboxSelect>> {ChangeState}
proc ChangeState {} {
global cities empty
set index [lindex [.lb1 curselection] 0]
if {$index != ""} {
.lb2 configure -listvariable cities([.lb1 get $index])
} else {
.lb2 configure -listvariable empty
}
}
pack .lb1 .lb2 -side left -padx 4 -pady 4
.lb2 configure -listvariable cities [.lb1 get $index]