From: Hidetoshi NAGAI Date: 2005-01-11T11:23:07+09:00 Subject: Re: calling tcl/tk scripts from ruby Hi, From: tony summerfelt Subject: calling tcl/tk scripts from ruby Date: Tue, 11 Jan 2005 04:41:55 +0900 Message-ID: > i just tried a loading a test.tcl via irb and it ran ok... > > the following didn't work though, in it's own file: > > require 'tk' > Tk.load_tclscript('test.tcl') > > i get: > > test.rb:3: undefined method `load_tclscript' for Tk:Module > (NoMethodError) Oh, sorry! That is one of many new features of Ruby1.8.2. The definition of the method is very simple. -------------------------------------------------------- def Tk.load_tclscript(file, enc=nil) if enc # TCL_VERSION >= 8.5 tk_call('source', '-encoding', enc, file) else tk_call('source', file) end end -------------------------------------------------------- Please add this or call Tk.tk_call('source', 'test.tcl'). -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)