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
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
(tof)
2003/06/19 Hidetoshi NAGAI
æ¬ããã¥ã¡ã³ãã«ã¯å¤ã tcltk ã©ã¤ãã©ãªï¼tcltklib ã©ã¤ãã©ãªã®èª¬æ
ãå«ã¾ãã¦ãã¾ããï¼ãã®è¨è¿°å
容ã¯å¤ããã®ã¨ãªã£ã¦ãã¾ãï¼
ã¾ãï¼ç¾å¨ã® Ruby/Tk ã®ä¸å¿ã§ãã tk.rb 㯠wish ãå¼ã³åºãããã¯ã
ãï¼tcltklib ã©ã¤ãã©ãªã wrap ãã¦åä½ãããã®ã¨ãªã£ã¦ãã¾ãï¼ãã®
ããï¼å¤ã説æè¨è¿°ã§è¿°ã¹ããã¦ãããããªããã»ã¹ééä¿¡ã«ãããªã¼ã
ãããã¯åå¨ãã¾ããï¼
ç¾å¨ã® tcltklib ã©ã¤ãã©ãªã§ãï¼Tcl/Tk ã® C ã©ã¤ãã©ãªããªã³ã¯ãã¦
ç´æ¥ã«åãããã¨ã§ï¼ãªã¼ãããããæ¼ããã¤ã¤ Tcl/Tk ã¤ã³ã¿ã¼ããªã¿
ã®ã»ã¼å
¨æ©è½ï¼æ¡å¼µã©ã¤ãã©ãªãå«ãï¼ã使ããç¹ã¯åãã§ãï¼ãããï¼
ãã®å½¹å²ã¯ã»ã¼ãtk.rb 以ä¸ã®ã©ã¤ãã©ãªãå¹æçã«åãããããã®ãã®ã
ã¨è¦ãªããã¦ããï¼ãã®ç®çã§ã¡ã³ããã³ã¹ããã¦ãã¾ãï¼
tk.rb ã®é«æ©è½åã«ä¼´ã£ã¦ï¼ä¸æ°´æºã®ã©ã¤ãã©ãªã§ãã tcltk ã©ã¤ãã©ãª
ï¼tcltk.rbï¼ã¯ãã®åå¨æ義ãæ¸ãã¦ããï¼ç¾å¨ã§ã¯ã¡ã³ããã³ã¹ã¯è¡ã
ãã¦ãã¾ããï¼
ãªãï¼å¤ã説æã§ã¯ãã¤ã³ãã£ã³ã°ã«ãããã¹ã¯ãªããã®è¿½å ã¯ã§ããªãã
ã¨ã¨ãªã£ã¦ãã¾ããï¼ç¾å¨ã® tk.rb ã§ã¯ãããå¯è½ã§ãããã¨ãè£è¶³ãã¦
ããã¾ãï¼
以ä¸ãã©ã¤ãã©ãªã®å¤ã説æææ¸ã§ãï¼
==============================================================
tcltk ã©ã¤ãã©ãª
tcltklib ã©ã¤ãã©ãª
Sep. 19, 1997 Y. Shigehiro
以ä¸, ãtcl/tkãã¨ãã表è¨ã¯, tclsh ã wish ãå®ç¾ãã¦ãã, ä¸è¬ã§ãã
ã¨ããã® tcl/tk ãæãã¾ã. ãtcltk ã©ã¤ãã©ãªã, ãtcltklib ã©ã¤ãã©
ãªãã¨ãã表è¨ã¯, æ¬ããã±ã¼ã¸ã«å«ã¾ãã ruby ç¨ã®ã©ã¤ãã©ãªãæãã¾ã.
[ãã¡ã¤ã«ã«ã¤ãã¦]
README.euc : ãã®ãã¡ã¤ã«(注æ, ç¹å¾´, ã¤ã³ã¹ãã¼ã«ã®æ¹æ³).
MANUAL.euc : ããã¥ã¢ã«.
lib/, ext/ : ã©ã¤ãã©ãªã®å®ä½.
sample/ : ããã¥ã¢ã«ä»£ããã®ãµã³ãã«ããã°ã©ã .
sample/sample0.rb : tcltklib ã©ã¤ãã©ãªã®ãã¹ã.
sample/sample1.rb : tcltk ã©ã¤ãã©ãªã®ãã¹ã.
tcl/tk (wish) ã§ã§ããããªãã¨ãä¸éãæ¸ãã¦ã¿ã¾ãã.
sample/sample2.rb : tcltk ã©ã¤ãã©ãªã®ãµã³ãã«.
maeda shugo (shugo@po.aianet.ne.jp) æ°ã«ãã
(`rb.tk' ã§æ¸ããã¦ãã) ruby ã®ãµã³ãã«ããã°ã©ã
http://www.aianet.or.jp/~shugo/ruby/othello.rb.gz
ã tcltk ã©ã¤ãã©ãªã使ãããã«, æ©æ¢°çã«å¤æ´ãã¦ã¿ã¾ãã.
demo/ : 100 æ¬ã®ç·ã 100 åæããã¢ããã°ã©ã .
æåã«ç©ºã«ã¼ãã®æéã測å®ã, ç¶ãã¦å®éã«ç·ãå¼ãæéã測å®ãã¾ã.
tcl/tk ã¯(å)æç»ã®ã¨ãã« backing store ã使ããã«å¾ç¾©ã« 10000 æ¬(?)
ç·ãå¼ãã®ã§, (å)æç»ãå§ããã¨, ãã·ã³ãããªãéããªãã¾ã.
demo/lines0.tcl : wish ç¨ã®ã¹ã¯ãªãã.
demo/lines1.rb : `tk.rb' ç¨ã®ã¹ã¯ãªãã.
demo/lines2.rb : tcltk ã©ã¤ãã©ãªç¨ã®ã¹ã¯ãªãã.
[注æ]
ã³ã³ãã¤ã«/å®è¡ã«ã¯, tcl/tk ã® C ã©ã¤ãã©ãªãå¿
è¦ã§ã.
ãã®ã©ã¤ãã©ãªã¯,
ruby-1.0-970701, ruby-1.0-970911, ruby-1.0-970919
FreeBSD 2.2.2-RELEASE
ããã³ãã®ããã±ã¼ã¸ jp-tcl-7.6.tgz, jp-tk-4.2.tgz
ã§ä½æ/åä½ç¢ºèªãã¾ãã. ä»ã®ç°å¢ã§ã¯åä½ãããã©ãããããã¾ãã.
TclTkLib.mainloop ãå®è¡ä¸ã« Control-C ãå¹ããªãã®ã¯ä¸ä¾¿ãªã®ã§, ruby
ã®ã½ã¼ã¹ãåèã«, #include "sig.h" ã㦠trap_immediate ãæä½ãã¦ãã¾
ãã, ruby ã® README.EXT ã«ãæ¸ãã¦ãªãã®ã«, ãããªãã¨ããã¦è¯ãã®ã
ã©ãããããã¾ãã.
-d ãªãã·ã§ã³ã§ãããã°æ
å ±ã表示ãããããã«, ruby ã®ã½ã¼ã¹ãåèã«,
debug ã¨ãã大åå¤æ°ãåç
§ãã¦ãã¾ãã, ruby ã® README.EXT ã«ãæ¸ãã¦
ãªãã®ã«, ãããªãã¨ããã¦è¯ãã®ãã©ãããããã¾ãã.
extconf.rb ã¯æ¸ãã¾ããã, (ãããããªæå³ã§)ããã§è¯ãã®ãè¯ãåãã
ã¾ãã.
[ç¹å¾´]
ruby ãã tcl/tk ã©ã¤ãã©ãªãå©ç¨ã§ãã¾ã.
tcl/tk ã¤ã³ã¿ããªã¿ã®ã¹ã¯ãªããã¯, æ©æ¢°çã« tcltk ã©ã¤ãã©ãªç¨ã® ruby
ã¹ã¯ãªããã«å¤æã§ãã¾ã.
(`tk.rb' ã¨ã®éã)
1. tcl/tk ã¤ã³ã¿ããªã¿ã®ã¹ã¯ãªããã, ã©ã®ããã«, tcltk ã©ã¤ãã©ãªç¨ã®
ruby ã¹ã¯ãªããã«å¤æãããããç解ã§ããã°, ããã¥ã¢ã«é¡ãç¡ãã«ç
ãã `tk.rb' ã¨ã¯ç°ãªã
tcl/tk ã®ããã¥ã¢ã«ããªã³ã©ã¤ã³ããã¥ã¡ã³ããç¨ãã¦
å¹çè¯ãããã°ã©ãã³ã°ãè¡ããã¨ãã§ãã¾ã.
è¨è¿°æ¹æ³ãããããªã, ã³ãã³ãã«ä¸ãããã©ã¡ã¼ã¿ãããããªã...
- Canvas.new { ... } ã¨, ãªãã¤ãã¬ã¼ã¿ãããã¯ãæ¸ããã®??
- Canvas ã® bbox ã¯æ°å¤ã®ãªã¹ããè¿ãã®ã«, xview ã¯æååãè¿ãã®??
ã¨, ãã¡ãã¡, ã©ã¤ãã©ãªã®ã½ã¼ã¹ã追ããããå¿
è¦ã¯ããã¾ãã.
2. åã
ã®æ©è½(ãªãã·ã§ã³)ãåå¥å¦çã«ãããµãã¼ããã¦ãã, ãã®ãããµ
ãã¼ããã¦ããªãæ©è½ã¯ä½¿ããã¨ãã§ããªã(æ¬å½ã¯ä½¿ããªããã¨ããªãã®
ã§ãã) `tk.rb' ã¨ã¯ç°ãªã, tcl/tk ã¤ã³ã¿ããªã¿ã§å¯è½ãªãã¨ã¯
ã»ã¨ãã©
ruby ãããå®è¡ã§ãã¾ã. ç¾å¨, ruby ããå®è¡ã§ããªããã¨ã確èªãã
ã¦ããã®ã¯,
bind ã³ãã³ãã§ã¹ã¯ãªããã追å ããæ§æ
ãbind tag sequence +scriptã
^
ã®ã¿ã§ã.
- `. configure -width' ããããã¨ãã¦, `Tk.root.height()' ã¨æ¸ã
ãã®ã«, `undefined method `height'' ã¨æããã¦ãã¾ã£ã. tk.rb ã
èªãã§ã¿ã¦, ã¬ã¼ã³. ã§ããªãã®ã...
ã¨ãããã¨ã¯ããã¾ãã.
3. wish ããã»ã¹ãèµ·åãããã»ã¹éé信㧠wish ãå©ç¨ãã `tk.rb' ã¨ã¯
ç°ãªã, tcl/tk ã® C ã©ã¤ãã©ãªããªã³ã¯ã
ããé«éã« (ã¨ãã£ã¦ã, æã£ãç¨ã¯éããªãã§ãã)
å¦çãè¡ãã¾ã.
4. `tk.rb' ã»ã©, é«æ°´æºãªã¤ã³ã¿ã¼ãã§ã¼ã¹ãåãã¦ããªããã, tcl/tk ã¤
ã³ã¿ããªã¿ã®çæç
ä½ããä½ã¾ã§èªåã§è¨è¿°
ããªããã°ãªãã¾ãã(ãã®ä»£ãã, tcl/tk ã©ã¤ãã©ãªã®ä»æ§éã,
tcl/tk ã¤ã³ã¿ããªã¿ãè¤æ°çæãããã¨ãã§ãã¾ãã).
ã¤ã³ã¿ã¼ãã§ã¼ã¹ã¯(ãããã) ruby ã®ææ³ã«æ²¿ã£ããã®ã§ã¯ããã¾ãã.
ã¾ã, ã¹ã¯ãªããã®è¨è¿°ã¯
ããµããµ
ã§ã. ã¹ã¯ãªããã¯, ä¸è¦, èªã¿ã¥ãããã®ã¨ãªãã¾ã. ã, æ¸ã人ã«ã¨ã£
ã¦ã¯, ããã»ã©ç
©ããããã®ã§ã¯ãªãã¨æãã¾ã.
[ã¤ã³ã¹ãã¼ã«ã®æ¹æ³]
0. ruby ã®ã½ã¼ã¹ãã¡ã¤ã«(ruby-1.0-ãªããã.tgz)ãå±éãã¦ããã¾ã.
1. ruby-1.0-ãªããã/ext ã« ext/tcltklib ãã³ãã¼ãã¾ã.
cp -r ext/tcltklib ???/ruby-1.0-ãªããã/ext/
2. ruby ã®ã¤ã³ã¹ãã¼ã«æ³ã«å¾ã make çããã¾ã.
3. ruby ã®ã©ã¤ãã©ãªç½®å ´ã« lib/* ãã³ãã¼ãã¾ã.
cp lib/* /usr/local/lib/ruby/
(eof)
|