blob: b8dbe9b236d84d98abbf8a41d6e913cd8283ad79 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#
# tkscrollbox.rb - Tk Listbox with Scrollbar
# as an example of Composite Widget
# $Date: 1995/12/12 18:21:01 $
# by Yukihiro Matsumoto <[email protected]>
require 'tk.rb'
class TkScrollbox<TkListbox
include TkComposite
def initialize_composite
list = TkListbox.new(@frame)
scroll = TkScrollbar.new(@frame)
@path = list.path
list.configure 'yscroll', scroll.path+" set"
list.pack 'side'=>'left','fill'=>'both','expand'=>'yes'
scroll.configure 'command', list.path+" yview"
scroll.pack 'side'=>'right','fill'=>'y'
delegate('DEFALUT', list)
delegate('foreground', list, scroll)
delegate('background', list, scroll)
delegate('borderwidth', @frame)
delegate('relief', @frame)
end
end
|