summaryrefslogtreecommitdiff
path: root/ruby_1_8_5/ext/tk/lib/tk/console.rb
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-15 23:23:39 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-15 23:23:39 +0000
commit6175ca03be6d0d51359f9017123708987d0f5eb7 (patch)
treeecfcf6e79a21b1d25c3f6f42dd68ea0a14add89c /ruby_1_8_5/ext/tk/lib/tk/console.rb
parent80a56b248b2e9cfc95622aed98750df05a19f667 (diff)
add tag v1_8_5_91v1_8_5_91
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_8_5_91@13046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby_1_8_5/ext/tk/lib/tk/console.rb')
-rw-r--r--ruby_1_8_5/ext/tk/lib/tk/console.rb52
1 files changed, 52 insertions, 0 deletions
diff --git a/ruby_1_8_5/ext/tk/lib/tk/console.rb b/ruby_1_8_5/ext/tk/lib/tk/console.rb
new file mode 100644
index 0000000000..26ce262caa
--- /dev/null
+++ b/ruby_1_8_5/ext/tk/lib/tk/console.rb
@@ -0,0 +1,52 @@
+#
+# tk/console.rb : control the console on system without a real console
+#
+require 'tk'
+
+module TkConsole
+ include Tk
+ extend Tk
+
+ 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
+ def self.hide
+ tk_call_without_enc('console', 'hide')
+ end
+ def self.show
+ tk_call_without_enc('console', 'show')
+ end
+ def self.eval(tcl_script)
+ #
+ # supports a Tcl script only
+ # I have no idea to support a Ruby script seamlessly.
+ #
+ _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