Version 0 of Hierarquical listbox

Updated 2005-08-24 11:22:06

Silas - 2005.08.24 - Here one code I used in one of my applications: I call this hierarquical listbox, because when you select one item of the left listbox (Parent) it changes all items of the right one (Child).

  bind Listbox <<ListboxSelect>> {
    set index [.lstPattern curselection]
    puts index
    set Child [lindex $Everything $index]
  }

  listbox .lstPattern -listvariable Pattern
  listbox .lstChild -listvariable Child
  pack .lstPattern .lstChild -side left

  set Pattern {one two three}
  set Everything {{child2 another blabla} {child2 go blabla} {child3 {another row}}}