diff options
Diffstat (limited to 'ext/tk/sample/tkmultilistframe.rb')
-rw-r--r-- | ext/tk/sample/tkmultilistframe.rb | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/ext/tk/sample/tkmultilistframe.rb b/ext/tk/sample/tkmultilistframe.rb index 220c80a3b9..dac1df5513 100644 --- a/ext/tk/sample/tkmultilistframe.rb +++ b/ext/tk/sample/tkmultilistframe.rb @@ -49,6 +49,9 @@ class TkMultiListFrame < TkListbox @title_border = 3 @h_l_thick = 0 + # init status + @mode = :title + # virtical scrollbar =begin @v_scroll = TkScrollbar.new(@frame, 'highlightthickness'=>@h_l_thick, @@ -212,11 +215,11 @@ class TkMultiListFrame < TkListbox @h_scroll.assign(@c_title, @c_lbox, @c_hscr) # binding for listboxes - @mode = {} - @mode['browse'] = browse_mode_bindtag - @mode['single'] = single_mode_bindtag - @mode['extended'] = extended_mode_bindtag - @mode['multiple'] = multiple_mode_bindtag + @lbox_mode = {} + @lbox_mode['browse'] = browse_mode_bindtag + @lbox_mode['single'] = single_mode_bindtag + @lbox_mode['extended'] = extended_mode_bindtag + @lbox_mode['multiple'] = multiple_mode_bindtag @current_mode = 'browse' @lbox_list.each_with_index{|l, idx| l.bind('Shift-Key-Left', @@ -233,7 +236,7 @@ class TkMultiListFrame < TkListbox l.scan_dragto(x, y) }, '%x %y') - l.bindtags(l.bindtags.unshift(@mode[@current_mode])) + l.bindtags(l.bindtags.unshift(@lbox_mode[@current_mode])) } bbox = @w_title.bbox @@ -315,8 +318,8 @@ class TkMultiListFrame < TkListbox def mode(sel_mode) @lbox_list.each{|l| tags = l.bindtags - tags = tags - [ @mode[@current_mode] ] - l.bindtags(tags.unshift(@mode[sel_mode])) + tags = tags - [ @lbox_mode[@current_mode] ] + l.bindtags(tags.unshift(@lbox_mode[sel_mode])) @current_mode = sel_mode } end |