aboutsummaryrefslogtreecommitdiffstats
path: root/ext/tk/sample/tkoptdb-safeTk.rb
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-09-02 17:17:20 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-09-02 17:17:20 +0000
commit0a054a5fd8f0b9d3a8c711990953988565593f49 (patch)
treea47b216d86779532dcfd6ac6a4765b7d2a7d5543 /ext/tk/sample/tkoptdb-safeTk.rb
parentabcd179a2bed3f837384fa14b610ff0d96384826 (diff)
downloadruby-0a054a5fd8f0b9d3a8c711990953988565593f49.tar.gz
* ext/tcltklib/tcltklib.c: fix typo [ruby-talk:111266]
* ext/tk/lib/tk/text.rb: fix typo * ext/tk/lib/multi-tk.rb: improve safe-level treatment on slave IPs git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/sample/tkoptdb-safeTk.rb')
-rw-r--r--ext/tk/sample/tkoptdb-safeTk.rb23
1 files changed, 21 insertions, 2 deletions
diff --git a/ext/tk/sample/tkoptdb-safeTk.rb b/ext/tk/sample/tkoptdb-safeTk.rb
index a5e394b230..ebbc7b486f 100644
--- a/ext/tk/sample/tkoptdb-safeTk.rb
+++ b/ext/tk/sample/tkoptdb-safeTk.rb
@@ -26,10 +26,29 @@ else
File.dirname(__FILE__)))
end
file = File.expand_path('tkoptdb.rb', File.dirname(__FILE__))
-MultiTkIp.new_safeTk{
- ent.each{|pat, val| TkOptionDB.add(pat, val)}
+
+ip = MultiTkIp.new_safeTk{
+ # When a block is given to 'new_safeTk' method,
+ # the block is evaluated on $SAFE==4.
+ ent.each{|pat, val| Tk.tk_call('option', 'add', pat, val)}
+}
+
+=begin
+ip.eval_proc{
+ # When a block is given to 'eval_proc' method,
+ # the block is evaluated on the IP's current safe level.
+ # So, the followings raises exceptions.
load file
}
+=end
+
+ip.eval_proc(proc{
+ # When a Procedure object is given to 'eval_proc' method as an argument,
+ # the proc is evaluated on the proc's binding.
+ # So, the followings are evaluated on $SAFE==0
+ load file
+})
+
# Tk.mainloop is ignored on the slave-IP
Tk.mainloop