25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
# File 'sample/tkextlib/treectrl/demo.rb', line 25
def initialize(dir)
@ScriptDir = dir || '.'
@thisPlatform = Tk::PLATFORM['platform']
if @thisPlatform == 'unix' && Tk.windowingsystem == 'aqua'
@thisPlatform = 'macosx'
end
@RandomN = [500]
@images = Hash.new
@sel_images = Hash.new
@popup = Hash.new
@mTree = Hash.new
@mHeader = Hash.new
@non_clear_list = []
@demoCmd = Hash.new
@demoFile = Hash.new
w = TkListbox.new
@SystemButtonFace = w[:highlightbackground]
@SystemHighlight = w[:selectbackground]
@SystemHighlightText = w[:selectforeground]
w.destroy
make_source_window()
()
make_main_window()
if $Version_1_1_OrLater
begin
@tree2[:backgroundimage]
@has_bgimg = true
rescue
@has_bgimg = false
end
else
@has_bgimg = false
end
()
()
init_pics('sky')
@tree2.bind('ButtonPress-3',
proc{|w, x, y, rootx, rooty|
(w, x, y, rootx, rooty)
}, '%W %x %y %X %Y')
if @thisPlatform == 'windows'
@tree2.bind_remove('Control-ButtonPress-3')
end
init_demo_scripts_module()
load_demo_scripts()
init_demo_list()
@tree1.notify_bind(@tree1, 'Selection',
proc{|c, t|
if c == 1
item = t.selection_get[0]
demo_set(@demoCmd[item], @demoFile[item])
end
}, '%c %T')
@tree2.notify_bind('DontDelete', 'Selection',
proc{|c, t|
display_styles_in_item(t.selection_get[0]) if c == 1
}, '%c %T')
end
|