TkComm (Module)

In: tk/lib/tk.rb

define TkComm module (step 2: event binding)

Constants

WidgetClassNames = {}.taint
Tk_IDs = ["00000".taint, "00000".taint].freeze # [0]-cmdid, [1]-winid
  Tk_CMDTBL = {} Tk_WINDOWS = {}
Tk_CMDTBL = Object.new
  for backward compatibility
Tk_WINDOWS = Object.new
GET_CONFIGINFO_AS_ARRAY = true
  GET_CONFIGINFO_AS_ARRAY = false => returns a Hash { opt =>val, … }
                          true  => returns an Array [[opt,val], ... ]

val is a list which includes resource info.

GET_CONFIGINFOwoRES_AS_ARRAY = true
  for configinfo without resource info; list of [opt, value] pair
          false => returns a Hash { opt=>val, ... }
          true  => returns an Array [[opt,val], ... ]
USE_TCLs_LIST_FUNCTIONS = true

Classes and Modules

Module TkComm::Tk_CMDTBL
Module TkComm::Tk_WINDOWS

Included Modules

TkUtil TkEvent

Public Instance methods

[Source]

# File tk/lib/tk.rb, line 765
  def bind(tagOrClass, context, cmd=Proc.new, args=nil)
    _bind(["bind", tagOrClass], context, cmd, args)
    tagOrClass
  end

[Source]

# File tk/lib/tk.rb, line 784
  def bind_all(context, cmd=Proc.new, args=nil)
    _bind(['bind', 'all'], context, cmd, args)
    TkBindTag::ALL
  end

[Source]

# File tk/lib/tk.rb, line 770
  def bind_append(tagOrClass, context, cmd=Proc.new, args=nil)
    _bind_append(["bind", tagOrClass], context, cmd, args)
    tagOrClass
  end

[Source]

# File tk/lib/tk.rb, line 789
  def bind_append_all(context, cmd=Proc.new, args=nil)
    _bind_append(['bind', 'all'], context, cmd, args)
    TkBindTag::ALL
  end

[Source]

# File tk/lib/tk.rb, line 775
  def bind_remove(tagOrClass, context)
    _bind_remove(['bind', tagOrClass], context)
    tagOrClass
  end

[Source]

# File tk/lib/tk.rb, line 794
  def bind_remove_all(context)
    _bind_remove(['bind', 'all'], context)
    TkBindTag::ALL
  end

[Source]

# File tk/lib/tk.rb, line 780
  def bindinfo(tagOrClass, context=nil)
    _bindinfo(['bind', tagOrClass], context)
  end

[Source]

# File tk/lib/tk.rb, line 799
  def bindinfo_all(context=nil)
    _bindinfo(['bind', 'all'], context)
  end

[Source]

# File tk/lib/tk.rb, line 439
  def image_obj(val)
    if val =~ /^i\d+$/
      TkImage::Tk_IMGTBL[val]? TkImage::Tk_IMGTBL[val] : val
    else
      val
    end
  end

[Source]

# File tk/lib/tk.rb, line 605
  def install_cmd(cmd)
    return '' if cmd == ''
    id = _next_cmd_id
    #Tk_CMDTBL[id] = cmd

    if cmd.kind_of?(TkCallbackEntry)
      TkCore::INTERP.tk_cmd_tbl[id] = cmd
    else
      TkCore::INTERP.tk_cmd_tbl[id] = TkCore::INTERP.get_cb_entry(cmd)
    end
    @cmdtbl = [] unless defined? @cmdtbl
    @cmdtbl.taint unless @cmdtbl.tainted?
    @cmdtbl.push id
    #return Kernel.format("rb_out %s", id);

    return 'rb_out ' + id
  end

[Source]

# File tk/lib/tk.rb, line 620
  def uninstall_cmd(id)
    id = $1 if /rb_out (c\d+)/ =~ id
    #Tk_CMDTBL.delete(id)

    TkCore::INTERP.tk_cmd_tbl.delete(id)
  end

[Validate]