~ubuntu-branches/ubuntu/intrepid/ruby1.8/intrepid-updates

« back to all changes in this revision

Viewing changes to ext/tk/lib/tk/console.rb

  • Committer: Bazaar Package Importer
  • Author(s): akira yamada
  • Date: 2007-03-13 22:11:58 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070313221158-h3oql37brlaf2go2
Tags: 1.8.6-1
* new upstream version, 1.8.6.
* libruby1.8 conflicts with libopenssl-ruby1.8 (< 1.8.6) (closes: #410018)
* changed packaging style to cdbs from dbs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
#   tk/console.rb : control the console on system without a real console
 
3
#
 
4
require 'tk'
 
5
 
 
6
module TkConsole
 
7
  include Tk
 
8
  extend Tk
 
9
 
 
10
  TkCommandNames = ['console'.freeze, 'consoleinterp'.freeze].freeze
 
11
 
 
12
  def self.create
 
13
    TkCore::INTERP._create_console
 
14
  end
 
15
  self.create  # initialize console
 
16
 
 
17
  def self.title(str=None)
 
18
    tk_call 'console', str
 
19
  end
 
20
  def self.hide
 
21
    tk_call_without_enc('console', 'hide')
 
22
  end
 
23
  def self.show
 
24
    tk_call_without_enc('console', 'show')
 
25
  end
 
26
  def self.eval(tcl_script)
 
27
    #
 
28
    # supports a Tcl script only
 
29
    # I have no idea to support a Ruby script seamlessly.
 
30
    #
 
31
    _fromUTF8(tk_call_without_enc('console', 'eval', 
 
32
                                  _get_eval_enc_str(tcl_script)))
 
33
  end
 
34
  def self.maininterp_eval(tcl_script)
 
35
    #
 
36
    # supports a Tcl script only
 
37
    # I have no idea to support a Ruby script seamlessly.
 
38
    #
 
39
    _fromUTF8(tk_call_without_enc('consoleinterp', 'eval', 
 
40
                                  _get_eval_enc_str(tcl_script)))
 
41
 
 
42
  end
 
43
  def self.maininterp_record(tcl_script)
 
44
    #
 
45
    # supports a Tcl script only
 
46
    # I have no idea to support a Ruby script seamlessly.
 
47
    #
 
48
    _fromUTF8(tk_call_without_enc('consoleinterp', 'record', 
 
49
                                  _get_eval_enc_str(tcl_script)))
 
50
 
 
51
  end
 
52
end