diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-07-23 16:07:35 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-07-23 16:07:35 +0000 |
commit | fd46a1da0a41b7939424bc5a393027be7940908e (patch) | |
tree | c77c6520287d10d2abab0f6e119d8eb5d7e36a80 /ext/tk/lib/tkafter.rb | |
parent | 528b6c3f6470cc24d6d5d39f0b573c76a74cc5c9 (diff) | |
download | ruby-fd46a1da0a41b7939424bc5a393027be7940908e.tar.gz |
process.c : unify indentation
configure.in : add --enable-setreuid option
tcltklib.c : TclTkIp.new accepts 'ip-name' and 'options'
( e.g. TclTkIp.new('FOO', '-geometry 500x200 -use 0x2200009') )
tk.rb : support arguments of TclTkIp.new
( see TkCore::IP_NAME, TkCore::IP_OPTS )
tk*.rb : preparations for multi-Tk interpreter support
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/tkafter.rb')
-rw-r--r-- | ext/tk/lib/tkafter.rb | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/ext/tk/lib/tkafter.rb b/ext/tk/lib/tkafter.rb index fec93a6a04..4401bce719 100644 --- a/ext/tk/lib/tkafter.rb +++ b/ext/tk/lib/tkafter.rb @@ -9,21 +9,13 @@ class TkTimer include TkCore extend TkCore - Tk_CBID = [0] - Tk_CBTBL = {} + TkCommandNames = ['after'.freeze].freeze - # this constant must be defined befor calling __add_target_for_init__ - TkINTERP_SETUP_SCRIPTS = [ - ["proc", "rb_after", "id", - "ruby [format \"#{self.name}.callback %%Q!%s!\" $id]"] - ] + Tk_CBID = ['a'.freeze, '00000'] + Tk_CBTBL = TkCore::INTERP.create_table - TkComm.__add_target_for_init__(self) - - def self.__init_tables__ - # cannot clear - # Tcl interpreter may keep callbacks - end + TkCore::INTERP.add_tk_procs('rb_after', 'id', + "ruby [format \"#{self.name}.callback %%Q!%s!\" $id]") ############################### @@ -108,8 +100,8 @@ class TkTimer end def initialize(*args) - @id = format("a%.4d", Tk_CBID[0]) - Tk_CBID[0] += 1 + @id = Tk_CBID.join + Tk_CBID[1].succ! @set_next = true |