diff options
author | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-06-06 04:47:43 +0000 |
---|---|---|
committer | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-06-06 04:47:43 +0000 |
commit | d993088277ef6bae6e64a27bbf1424ef1727a101 (patch) | |
tree | b8b22d7985627588afdab587d573e2443cead1c7 /ext/tk | |
parent | aa91b7bd5d94e2b0e4150734719a21db9afd5ce9 (diff) | |
download | ruby-d993088277ef6bae6e64a27bbf1424ef1727a101.tar.gz |
* ext/tk/lib/tk/console.rb: create console when required
* ext/tk/sample/tkextlib/tile/demo.rb: create Console (commit miss?)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk')
-rw-r--r-- | ext/tk/lib/tk/console.rb | 22 | ||||
-rw-r--r-- | ext/tk/sample/tkextlib/tile/demo.rb | 1 |
2 files changed, 22 insertions, 1 deletions
diff --git a/ext/tk/lib/tk/console.rb b/ext/tk/lib/tk/console.rb index 1a267b717c..26ce262caa 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 diff --git a/ext/tk/sample/tkextlib/tile/demo.rb b/ext/tk/sample/tkextlib/tile/demo.rb index ce453bc4b0..6603304b1f 100644 --- a/ext/tk/sample/tkextlib/tile/demo.rb +++ b/ext/tk/sample/tkextlib/tile/demo.rb @@ -510,6 +510,7 @@ m_file.add(:checkbutton, :label=>'Text check', :underline=>5, m_file.insert(:end, :separator) if Tk.windowingsystem != 'x11' + TkConsole.create m_file.insert(:end, :checkbutton, :label=>'Console', :underline=>5, :variable=>$V.ref(:CONSOLE), :command=>proc{toggle_console()}) def toggle_console |