how to change the values in a combobox dynamically in Ruby Tk -


the idea quite simple: have 2 comboboxes. second 1 should refreseh values depending on chose first one.

# combobox 1: $shape = tkvariable.new $combobox_1 = tk::tile::combobox.new(parent) { textvariable $shape; values ['ipe', 'hea']}  # combobox 2: $size = tkvariable.new $combobox_2 = tk::tile::combobox.new(parent) { textvariable $size; values $size_list}  # action $combobox_1.bind("<comboboxselected>") {   case $shape   when 'ipe' $size_list = [80, 100, ...]   when 'hea' $size_list = [90, 130, ...]   end   } 

but nothing happens. combobox 2 doesn't seem realize values have been changed. how can solve problem?

this not work, used variable create combo box, changing not change combobox.

i suppose looking set

when 'ipe' $combobox_2.values([80, 100, ...]) 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -