diff options
| author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-09-02 17:17:20 +0000 |
|---|---|---|
| committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-09-02 17:17:20 +0000 |
| commit | 2fe633b7492890808b0ff7f3e57c5de2dd98ccee (patch) | |
| tree | a47b216d86779532dcfd6ac6a4765b7d2a7d5543 /ext/tk/sample | |
| parent | 0633bc830d0e6fc20b9a19faf9a1c367270d0ed4 (diff) | |
| download | ruby-2fe633b7492890808b0ff7f3e57c5de2dd98ccee.tar.gz ruby-2fe633b7492890808b0ff7f3e57c5de2dd98ccee.tar.xz ruby-2fe633b7492890808b0ff7f3e57c5de2dd98ccee.zip | |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@6852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/sample')
| -rw-r--r-- | ext/tk/sample/tkoptdb-safeTk.rb | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/ext/tk/sample/tkoptdb-safeTk.rb b/ext/tk/sample/tkoptdb-safeTk.rb index a5e394b23..ebbc7b486 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 |
