summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-09-03 02:33:08 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-09-03 02:33:08 +0000
commitc5f07b3cbce4519049b3129878e379404a3492e8 (patch)
tree43e943a5d01b71175ccdda5810ddcb22ba3ffa97
parentb609f925a317a5562f1f11f7188450fa09bdb52e (diff)
* 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/branches/ruby_1_8@6853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ext/tk/lib/tk.rb16
2 files changed, 19 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 9b9aa56..b786ed8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Sep 3 11:31:44 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * ext/tk/lib/tk.rb: Tk.after makes TkCore::INTERP.tk_cmd_tbl grow
+ [ruby-dev:24207]
+
Fri Sep 3 02:12:48 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tcltklib/tcltklib.c: fix typo [ruby-talk:111266]
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb
index 800031a..e6a4dd1 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