#!/usr/bin/env ruby require 'multi-tk' TkMessage.new(:text => < ", ip.eval_proc{$SAFE}, "\n" ret = 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 an exception. # An Exception object of the exception is returned as a # return value of this method. load file } print "ip.eval_proc{}, which includes insecure operiation in the given block, returns an exception object: ", ret.inspect, "\n" print "If a proc object is given, the proc is evaluated on the safe-level which is kept on the proc :: ip.eval_proc( proc{$SAFE} ) ==> ", ip.eval_proc(proc{$SAFE}), "\n" safe0_cmd = Proc.new{ # This proc object keeps current safe-level ($SAFE==0). load file } ip.eval_proc(safe0_cmd) # Tk.mainloop is ignored on the slave-IP Tk.mainloop