diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-09-03 02:33:08 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-09-03 02:33:08 +0000 |
commit | 7cf8256075020e1dd80800807e3d92f3350511e6 (patch) | |
tree | 37377afef3e7da5e819326c0f38866bf8e3f02af /ext/tk/lib/tk.rb | |
parent | 0a054a5fd8f0b9d3a8c711990953988565593f49 (diff) | |
download | ruby-7cf8256075020e1dd80800807e3d92f3350511e6.tar.gz |
* ext/tk/lib/tk.rb: Tk.after makes TkCore::INTERP.tk_cmd_tbl grow [ruby-dev:24207]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/tk.rb')
-rw-r--r-- | ext/tk/lib/tk.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb index 800031a682..e6a4dd14e4 100644 --- a/ext/tk/lib/tk.rb +++ b/ext/tk/lib/tk.rb @@ -1191,8 +1191,14 @@ module TkCore end def after(ms, cmd=Proc.new) + crit_bup = Thread.critical + Thread.critical = true + myid = _curr_cmd_id - cmdid = install_cmd(cmd) + cmdid = install_cmd(proc{ret = cmd.call;uninstall_cmd(myid); ret}) + + Thread.critical = crit_bup + tk_call_without_enc("after",ms,cmdid) # return id # return # if false #defined? Thread @@ -1209,8 +1215,14 @@ module TkCore end def after_idle(cmd=Proc.new) + crit_bup = Thread.critical + Thread.critical = true + myid = _curr_cmd_id - cmdid = install_cmd(cmd) + cmdid = install_cmd(proc{ret = cmd.call;uninstall_cmd(myid); ret}) + + Thread.critical = crit_bup + tk_call_without_enc('after','idle',cmdid) end |