summaryrefslogtreecommitdiff
path: root/ext/tk/lib/multi-tk.rb
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-14 15:25:45 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-14 15:25:45 +0000
commit382b4ae9a34c2f697464e1e42fd0fdc277fdd3c3 (patch)
tree2411731a86321077cae6101089d0e76f96c97cb4 /ext/tk/lib/multi-tk.rb
parent6adad139461f64d6bc011df2236d21f53c5fac8c (diff)
ext/tcltklib/tcltklib.c:
* replace Tcl/Tk's vwait and tkwait to switch on threads smoothly and avoid seg-fault. * add TclTkIp._thread_vwait and _thread_tkwait for waiting on a thread. ( Because Tcl/Tk's vwait and tkwait command wait on a eventloop. ) ext/tk/lib/multi-tk.rb: * support TclTkIp._thread_vwait and _thread_tkwait ext/tk/lib/tk.rb: * now, TkVariable#wait has 2 arguments. If 1st argument is true, waits on a thread. If false, waits on an eventloop. If 2nd argument is true, checks existence of rootwidgets. If false, doesn't. Default is wait(true, false). * add TkVariable#tkwait(arg) which is equal to TkVariable#wait(arg, true) * wait_visibility and wait_destroy have an argument for waiting on a thread or an eventloop. * improve of accessing Tcl/Tk's special variables ext/tk/lib/tkafter.rb: * support 'wait on a thread' and 'wait on an eventloop' git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/multi-tk.rb')
-rw-r--r--ext/tk/lib/multi-tk.rb22
1 files changed, 20 insertions, 2 deletions
diff --git a/ext/tk/lib/multi-tk.rb b/ext/tk/lib/multi-tk.rb
index 750a2b79d9..288b5be443 100644
--- a/ext/tk/lib/multi-tk.rb
+++ b/ext/tk/lib/multi-tk.rb
@@ -306,7 +306,8 @@ class MultiTkIp
# check 'display'
if !new_keys.key?('display')
begin
- new_keys['display'] = @interp._eval('winfo screen .')
+ #new_keys['display'] = @interp._invoke('winfo screen .')
+ new_keys['display'] = @interp._invoke('winfo', 'screen', '.')
rescue
if ENV[DISPLAY]
new_keys['display'] = ENV[DISPLAY]
@@ -323,7 +324,8 @@ class MultiTkIp
case new_keys['use']
when TkWindow
new_keys['use'] = TkWinfo.id(new_keys['use'])
- assoc_display = @interp._eval('winfo screen .')
+ #assoc_display = @interp._eval('winfo screen .')
+ assoc_display = @interp._invoke('winfo', 'screen', '.')
when /^\..*/
new_keys['use'] = @interp._invoke('winfo', 'id', new_keys['use'])
assoc_display = @interp._invoke('winfo', 'screen', new_keys['use'])
@@ -925,6 +927,14 @@ class << MultiTkIp
__getip._fromUTF8(str, encoding)
end
+ def _thread_vwait(var)
+ __getip._thread_vwait(var)
+ end
+
+ def _thread_tkwait(mode, target)
+ __getip._thread_tkwait(mode, target)
+ end
+
def _return_value
__getip._return_value
end
@@ -1039,6 +1049,14 @@ class MultiTkIp
@interp._fromUTF8(str, encoding)
end
+ def _thread_vwait(var)
+ @interp._thread_vwait(var)
+ end
+
+ def _thread_tkwait(mode, target)
+ @interp._thread_tkwait(mode, target)
+ end
+
def _return_value
@interp._return_value
end