In Files

  • tk/lib/tk/canvastag.rb

Parent

Methods

Class/Module Index [+]

Quicksearch

TkcTagString

Public Class Methods

new(parent, name, mode=nil, *args) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 338
def self.new(parent, name, mode=nil, *args)
  obj = nil
  CTagID_TBL.mutex.synchronize{
    if CTagID_TBL[parent.path] && CTagID_TBL[parent.path][name]
      obj = CTagID_TBL[parent.path][name]
    else
      # super(parent, name, *args)
      (obj = self.allocate).instance_eval{
        @c = parent
        @cpath = parent.path
        @path = @id = name
        CTagID_TBL[@cpath] = {} unless CTagID_TBL[@cpath]
        CTagID_TBL[@cpath][@id] = self
      }
    end
  }
  if obj && mode
    tk_call_without_enc(@c.path, "addtag", @id, mode, *args)
  end
  obj
end
            
new(parent, name, mode=nil, *args) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 360
def initialize(parent, name, mode=nil, *args)
  # dummy:: not called by 'new' method

  #unless parent.kind_of?(TkCanvas)
  #  fail ArgumentError, "expect TkCanvas for 1st argument"
  #end
  @c = parent
  @cpath = parent.path
  @path = @id = name

  if mode
    tk_call_without_enc(@c.path, "addtag", @id, mode, *args)
  end
end
            

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 Documenting-ruby.org.