summaryrefslogtreecommitdiff
path: root/ext/tk/lib/tkconsole.rb
blob: d97df159fc7d33805165915f6adea6bad2934d72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#
#   tkconsole.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 'console', 'hide'
  end
  def self.show
    tk_call 'console', 'show'
  end
  def self.eval(tcl_script)
    #
    # supports a Tcl script only
    # I have no idea to support a Ruby script seamlessly.
    #
    tk_call 'console', 'eval', tcl_script
  end
end