diff options
Diffstat (limited to 'ext/tk/lib/tk/console.rb')
-rw-r--r-- | ext/tk/lib/tk/console.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/ext/tk/lib/tk/console.rb b/ext/tk/lib/tk/console.rb new file mode 100644 index 0000000000..855ee6a94f --- /dev/null +++ b/ext/tk/lib/tk/console.rb @@ -0,0 +1,29 @@ +# +# tk/console.rb : control the console on system without a real console +# +require 'tk' + +module TkConsole + include Tk + extend Tk + + TkCommandNames = ['console'.freeze].freeze + + 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 +end |