From: NAGAI Hidetoshi Date: 1998-06-10T19:05:22+09:00 Subject: [ruby-list:8281] Re: TkGrid do not exist? 永井@知能.九工大です. >>>>> "M" == Yukihiro Matsumoto writes: M> In message "[ruby-list:8270] Re: TkGrid do not exist?" M> on 98/06/10, NAGAI Hidetoshi writes: M> |以下に差分を付けます. M> 了解,取り込みました. ありがとうございます. M> 今日にでも1.1b9_25が出るでしょう. さらに tk.rb のバグらしきもの + 機能追加です. # 以下のように cget を実装して, # ボタンなどに設定した command をテストしてて気付きました. --- /usr/src/ruby-1.1b9_23/lib/tk.rb Thu Apr 30 16:44:03 1998 +++ tk.rb Wed Jun 10 19:03:29 1998 @@ -26,6 +26,9 @@ private :error_at def tk_tcl2ruby(val) + if val =~ /^rb_out (c\d+)/ + return Tk_CMDTBL[$1] + end if val.include? ?\s return val.split.collect{|v| tk_tcl2ruby(v)} end @@ -34,8 +37,6 @@ val.to_i when /^\./ Tk_WINDOWS[val] - when /^rb_out (c\d+)/ - Tk_CMDTBL[$1] when / / val.split.collect{|elt| tk_tcl2ruby(elt) @@ -134,6 +135,7 @@ def _next_cmd_id id = _curr_cmd_id Tk_IDs[0] += 1 + id end def install_cmd(cmd) return '' if cmd == '' @@ -833,8 +835,16 @@ end end + def [](id) + cget id + end + def []=(id, val) configure id, val + end + + def cget(slot) + tk_tcl2ruby tk_call path, 'cget', "-#{slot}" end def configure(slot, value)