diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-20 15:15:51 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-20 15:15:51 +0000 |
commit | 342aba0b84ebdfeab49f5ef0c6f9750d59e492f8 (patch) | |
tree | ddc1b5fee6d6f69d09339300c38ece9fbded2675 /ext/tk/sample | |
parent | a679f1861fc6ba25127433325e39d04e32c919c9 (diff) | |
download | ruby-342aba0b84ebdfeab49f5ef0c6f9750d59e492f8.tar.gz |
* ext/tk/lib/tk.rb: add new methods (TkScrollbar#assign, assign_list)
* ext/tk/sample/tkmultilistframe.rb: use TkScrollbar#assign method
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/sample')
-rw-r--r-- | ext/tk/sample/tkmultilistframe.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/ext/tk/sample/tkmultilistframe.rb b/ext/tk/sample/tkmultilistframe.rb index b67f8f8dac..220c80a3b9 100644 --- a/ext/tk/sample/tkmultilistframe.rb +++ b/ext/tk/sample/tkmultilistframe.rb @@ -50,14 +50,24 @@ class TkMultiListFrame < TkListbox @h_l_thick = 0 # virtical scrollbar +=begin @v_scroll = TkScrollbar.new(@frame, 'highlightthickness'=>@h_l_thick, 'borderwidth'=>@scrbar_border, 'orient'=>'vertical', 'width'=>@scrbar_width) +=end + @v_scroll = TkYScrollbar.new(@frame, 'highlightthickness'=>@h_l_thick, + 'borderwidth'=>@scrbar_border, + 'width'=>@scrbar_width) # horizontal scrollbar +=begin @h_scroll = TkScrollbar.new(@frame, 'highlightthickness'=>@h_l_thick, 'borderwidth'=>@scrbar_border, 'orient'=>'horizontal', 'width'=>@scrbar_width) +=end + @h_scroll = TkXScrollbar.new(@frame, 'highlightthickness'=>@h_l_thick, + 'borderwidth'=>@scrbar_border, + 'width'=>@scrbar_width) # create base flames @c_title = TkCanvas.new(@frame, 'highlightthickness'=>@h_l_thick, @@ -118,18 +128,27 @@ class TkMultiListFrame < TkListbox # scrollbar field f = TkFrame.new(@f_hscr, 'width'=>width) base << f +=begin @hscr_list << TkScrollbar.new(f, 'orient'=>'horizontal', 'width'=>@scrbar_width, 'borderwidth'=>@scrbar_border, 'highlightthickness'=>@h_l_thick ).pack('fill'=>'x', 'anchor'=>'w') +=end + @hscr_list << TkXScrollbar.new(f, 'width'=>@scrbar_width, + 'borderwidth'=>@scrbar_border, + 'highlightthickness'=>@h_l_thick + ).pack('fill'=>'x', 'anchor'=>'w') f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>1, 'relwidth'=>@rel_list[idx+1] - @rel_list[idx]) +=begin @lbox_list[idx].xscrollcommand proc{|first, last| @hscr_list[idx].set first, last } @hscr_list[idx].command proc{|*args| @lbox_list[idx].xview *args} +=end + @lbox_list[idx].xscrollbar(@hscr_list[idx]) # add new base @base_list << base @@ -163,14 +182,18 @@ class TkMultiListFrame < TkListbox @f_hscr.height hscr_height # set control procedure for virtical scroll +=begin @lbox_list.each{|lbox| lbox.yscrollcommand proc{|first, last| @v_scroll.set first, last } } @v_scroll.command proc{|*args| @lbox_list.each{|lbox| lbox.yview *args} } +=end + @v_scroll.assign(*@lbox_list) # set control procedure for horizoncal scroll +=begin @c_title.xscrollcommand proc{|first, last| @h_scroll.set first, last } @@ -185,6 +208,8 @@ class TkMultiListFrame < TkListbox @c_lbox.xview *args @c_hscr.xview *args if @show_each_hscr } +=end + @h_scroll.assign(@c_title, @c_lbox, @c_hscr) # binding for listboxes @mode = {} |