In Files

  • tk/lib/tcltk.rb

Class/Module Index [+]



module TclTk: collection of tcl/tk utilities (supplies namespace.)

Public Class Methods

_addcallback(ca) click to toggle source

TclTk._addcallback(ca): register callback

ca: callback(TclTkCallback)
               # File tk/lib/tcltk.rb, line 53
def TclTk._addcallback(ca)
  print("_addcallback: ", ca.to_s(), "\n") if $DEBUG
  @callback[ca.to_s()] = ca
_callcallback(key, arg) click to toggle source

TclTk._callcallback(key, arg): invoke registered callback

key: key to select callback (to_s value of the TclTkCallback)
arg: parameter from tcl/tk interpreter
               # File tk/lib/tcltk.rb, line 61
def TclTk._callcallback(key, arg)
  print("_callcallback: ", @callback[key].inspect, "\n") if $DEBUG
  # throw out callback value
  # should return String to satisfy rb_eval_string()
  return ""
_newname(prefix) click to toggle source

TclTk._newname(prefix): generate unique name(String)

prefix: prefix of the unique name
               # File tk/lib/tcltk.rb, line 71
def TclTk._newname(prefix)
  # generated name counter is stored in @namecnt
  if !@namecnt.key?(prefix)
    # first appearing prefix, initialize
    @namecnt[prefix] = 1
    # already appeared prefix, generate next name
    @namecnt[prefix] += 1
  return "#{prefix}#{@namecnt[prefix]}"
dcb(ca, wid, w) click to toggle source

::dcb(ca, wid, W): call ::deletecallbackkey for each callbacks

  in an array.
  this is for callback for top-level <Destroy>
ca: array of callbacks(TclTkCallback)
wid: top-level widget(TclTkWidget)
w: information about window given by %W(String)
               # File tk/lib/tcltk.rb, line 43
def TclTk.dcb(ca, wid, w)
  if wid.to_s() == w
deletecallbackkey(ca) click to toggle source

::deletecallbackkey: remove callback from TclTk module

  this does not remove callbacks from tcl/tk interpreter
  without calling this method, TclTkInterpreter will not be GCed
ca: callback(TclTkCallback)
               # File tk/lib/tcltk.rb, line 32
def TclTk.deletecallbackkey(ca)
  print("deletecallbackkey: ", ca.to_s(), "\n") if $DEBUG
mainloop() click to toggle source

::mainloop: call TclTkLib.mainloop

               # File tk/lib/tcltk.rb, line 22
def TclTk.mainloop()
  print("mainloop: start\n") if $DEBUG
  print("mainloop: end\n") if $DEBUG

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit