TkTextNamedTag (Class)

In: tk/lib/tk/texttag.rb
Parent: TkTextTag

Methods

new   new  

Public Class methods

[Source]

# File tk/lib/tk/texttag.rb, line 190
  def self.new(parent, name, *args)
    if TTagID_TBL[parent.path] && TTagID_TBL[parent.path][name]
      tagobj = TTagID_TBL[parent.path][name]
      if args != [] then
        keys = args.pop
        if keys.kind_of? Hash then
          tagobj.add(*args) if args != []
          tagobj.configure(keys)
        else
          args.push keys
          tagobj.add(*args)
        end
      end
      return tagobj
    else
      super(parent, name, *args)
    end
  end

[Source]

# File tk/lib/tk/texttag.rb, line 209
  def initialize(parent, name, *args)
    unless parent.kind_of?(TkText)
      fail ArguemntError, "expect TkText for 1st argument"
    end
    @parent = @t = parent
    @tpath = parent.path
    @path = @id = name
    TTagID_TBL[@tpath] = {} unless TTagID_TBL[@tpath]
    TTagID_TBL[@tpath][@id] = self unless TTagID_TBL[@tpath][@id]
    #if mode

    #  tk_call @t.path, "addtag", @id, *args

    #end

    if args != [] then
      keys = args.pop
      if keys.kind_of? Hash then
        add(*args) if args != []
        configure(keys)
      else
        args.push keys
        add(*args)
      end
    end
    @t._addtag id, self
  end

[Validate]