summaryrefslogtreecommitdiffstats
path: root/ext/tk/lib
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-06-05 14:03:41 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-06-05 14:03:41 +0000
commit03ad6d04e7e9c227db912d2f95a2813045caae9f (patch)
tree8bd13da500738f72c52779b5cbd8e17fed541087 /ext/tk/lib
parenta0ced1497082b8230e51760d3600a43d812580b6 (diff)
downloadruby-03ad6d04e7e9c227db912d2f95a2813045caae9f.tar.gz
ruby-03ad6d04e7e9c227db912d2f95a2813045caae9f.tar.xz
ruby-03ad6d04e7e9c227db912d2f95a2813045caae9f.zip
* ext/tk/lib/tk/console.rb: create console when required
* ext/tk/sample/tkextlib/tile/demo.rb: fix TypeError & create Console git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib')
-rw-r--r--ext/tk/lib/tk/console.rb22
1 files changed, 21 insertions, 1 deletions
diff --git a/ext/tk/lib/tk/console.rb b/ext/tk/lib/tk/console.rb
index 1a267b717..26ce262ca 100644
--- a/ext/tk/lib/tk/console.rb
+++ b/ext/tk/lib/tk/console.rb
@@ -7,11 +7,13 @@ module TkConsole
include Tk
extend Tk
- TkCommandNames = ['console'.freeze].freeze
+ TkCommandNames = ['console'.freeze, 'consoleinterp'.freeze].freeze
def self.create
TkCore::INTERP._create_console
end
+ self.create # initialize console
+
def self.title(str=None)
tk_call 'console', str
end
@@ -29,4 +31,22 @@ module TkConsole
_fromUTF8(tk_call_without_enc('console', 'eval',
_get_eval_enc_str(tcl_script)))
end
+ def self.maininterp_eval(tcl_script)
+ #
+ # supports a Tcl script only
+ # I have no idea to support a Ruby script seamlessly.
+ #
+ _fromUTF8(tk_call_without_enc('consoleinterp', 'eval',
+ _get_eval_enc_str(tcl_script)))
+
+ end
+ def self.maininterp_record(tcl_script)
+ #
+ # supports a Tcl script only
+ # I have no idea to support a Ruby script seamlessly.
+ #
+ _fromUTF8(tk_call_without_enc('consoleinterp', 'record',
+ _get_eval_enc_str(tcl_script)))
+
+ end
end