diff options
Diffstat (limited to 'ext/tk/lib/tkafter.rb')
-rw-r--r-- | ext/tk/lib/tkafter.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ext/tk/lib/tkafter.rb b/ext/tk/lib/tkafter.rb index b7c21e7529..5176db3e35 100644 --- a/ext/tk/lib/tkafter.rb +++ b/ext/tk/lib/tkafter.rb @@ -12,7 +12,15 @@ class TkAfter Tk_CBID = [0] Tk_CBTBL = {} - INTERP._invoke("proc", "rb_after", "id", "ruby [format \"TkAfter.callback %%Q!%s!\" $id]") + TkComm::INITIALIZE_TARGETS << self + + def self.__init_tables__ + # cannot clear + # Tcl interpreter may keep callbacks + end + + INTERP._invoke("proc", "rb_after", "id", + "ruby [format \"TkAfter.callback %%Q!%s!\" $id]") ############################### # class methods @@ -310,3 +318,5 @@ class TkAfter end end end + +TkTimer = TkAfter |