2 # tkscrollbox.rb - Tk Listbox with Scrollbar
3 # as an example of Composite Widget
4 # $Date: 2002/02/01 06:36:18 $
5 # by Yukihiro Matsumoto <matz@netlab.co.jp>
9 class TkScrollbox<TkListbox
11 def initialize_composite(keys=nil)
12 list = TkListbox.new(@frame)
13 scroll = TkScrollbar.new(@frame)
16 list.configure 'yscroll', scroll.path+" set"
17 list.pack 'side'=>'left','fill'=>'both','expand'=>'yes'
18 scroll.configure 'command', list.path+" yview"
19 scroll.pack 'side'=>'right','fill'=>'y'
21 delegate('DEFAULT', list)
22 delegate('foreground', list)
23 delegate('background', list, scroll)
24 delegate('borderwidth', @frame)
25 delegate('relief', @frame)
27 configure keys if keys