start Tk which depends on MultiTkIp

Namespace
Methods
C
I
N
T
Included Modules
Constants
INTERP_THREAD = MultiTkIp::INTERP_THREAD
 
INTERP_THREAD_STATUS = MultiTkIp::INTERP_THREAD_STATUS
 
INTERP_MUTEX = MultiTkIp::INTERP_MUTEX
 
INTERP_ROOT_CHECK = MultiTkIp::INTERP_ROOT_CHECK
 
INTERP = MultiTkIp
 

#<RDoc::Comment:0x007f194ba18a40>


#<RDoc::Comment:0x007f19404ae0d8>


#<RDoc::Comment:0x007f19407f1380>


#<RDoc::Comment:0x007f1940a3ec50>


#<RDoc::Comment:0x007f1940bf3118>


#<RDoc::Comment:0x007f1940e59808>


#<RDoc::Comment:0x007f194120d0d0>


#<RDoc::Comment:0x007f194144a140>


#<RDoc::Comment:0x007f194357a860>


#<RDoc::Comment:0x007f1943b2a468>


#<RDoc::Comment:0x007f193e967798>


#<RDoc::Comment:0x007f193eb18920>


#<RDoc::Comment:0x007f193ceb18b8>

WITH_RUBY_VM = Object.const_defined?(:RubyVM) && ::RubyVM.class == Class
 
WITH_ENCODING = defined?(::Encoding.default_external) && true
 
RUN_EVENTLOOP_ON_MAIN_THREAD = true
 

*** KNOWN BUG ***

Main event loop thread of TkAqua (> Tk8.4.9) must be the main
application thread. So, ruby1.9 users must call Tk.mainloop on
the main application thread.

*** ADD (2009/05/10) ***

In some cases (I don't know the description of conditions),
TkAqua 8.4.7 has a same kind of hang-up trouble.
So, if 8.4.7 or later, set RUN_EVENTLOOP_ON_MAIN_THREAD to true.
When you want to control this mode, please call the following
(set true/false as you want) before "require 'tk'".
----------------------------------------------------------
module TkCore; RUN_EVENTLOOP_ON_MAIN_THREAD = true; end
----------------------------------------------------------

*** ADD (2010/07/05) ***

The value of TclTkLib::WINDOWING_SYSTEM is defined at compiling.
If it is inconsistent with linked DLL, please call the following
before "require 'tk'".
----------------------------------------------------------
require 'tcltklib'
module TclTkLib
  remove_const :WINDOWING_SYSTEM
  WINDOWING_SYSTEM = 'x11' # or 'aqua'
end
----------------------------------------------------------
WIDGET_DESTROY_HOOK = '<WIDGET_DESTROY_HOOK>'
 
EventFlag = TclTkLib::EventFlag
 
Class Public methods
callback(*arg)
# File ext/tk/lib/tk.rb, line 1588
def TkCore.callback(*arg)
  begin
    if TkCore::INTERP.tk_cmd_tbl.kind_of?(Hash)
      #TkCore::INTERP.tk_cmd_tbl[arg.shift].call(*arg)
      normal_ret = false
      ret = catch(:IRB_EXIT) do  # IRB hack
        retval = TkCore::INTERP.tk_cmd_tbl[arg.shift].call(*arg)
        normal_ret = true
        retval
      end
      unless normal_ret
        # catch IRB_EXIT
        exit(ret)
      end
      ret
    end
  rescue SystemExit=>e
    exit(e.status)
  rescue Interrupt=>e
    fail(e)
  rescue Exception => e
    begin
      msg = _toUTF8(e.class.inspect) + ': ' +
            _toUTF8(e.message) + "\n" +
            "\n---< backtrace of Ruby side >-----\n" +
            _toUTF8(e.backtrace.join("\n")) +
            "\n---< backtrace of Tk side >-------"
      if TkCore::WITH_ENCODING
        msg.force_encoding('utf-8')
      else
        msg.instance_variable_set(:@encoding, 'utf-8')
      end
    rescue Exception
      msg = e.class.inspect + ': ' + e.message + "\n" +
            "\n---< backtrace of Ruby side >-----\n" +
            e.backtrace.join("\n") +
            "\n---< backtrace of Tk side >-------"
    end
    # TkCore::INTERP._set_global_var('errorInfo', msg)
    # fail(e)
    fail(e, msg)
  end
end
new(ip, cmd)
# File ext/tk/lib/tk.rb, line 1392
def initialize(ip, cmd)
  @ip = ip
  @cmd = cmd
end
Instance Public methods
call(*args)
# File ext/tk/lib/tk.rb, line 1397
def call(*args)
  @ip.cb_eval(@cmd, *args)
end
callback_break()
# File ext/tk/lib/tk.rb, line 1576
def callback_break
  fail TkCallbackBreak, "Tk callback returns 'break' status"
end
callback_continue()
# File ext/tk/lib/tk.rb, line 1580
def callback_continue
  fail TkCallbackContinue, "Tk callback returns 'continue' status"
end
callback_return()
# File ext/tk/lib/tk.rb, line 1584
def callback_return
  fail TkCallbackReturn, "Tk callback returns 'return' status"
end
inspect()
Also aliased as: to_s
# File ext/tk/lib/tk.rb, line 1386
def inspect
  sprintf("#<Class(TkCallbackEntry):%0x>", self.__id__)
end
to_s()
Alias for: inspect