Class: TkcTag

Class | TkcTag
In: | tk/lib/tk/canvastag.rb
Parent: | TkObject

### Methods

above all below closest delete destroy enclosed exist? id id2obj new overlapping remove set_to_above set_to_all set_to_below set_to_closest set_to_enclosed set_to_overlapping set_to_withtag withtag

### Included Modules

TkcTagAccess

### Constants

CTagID_TBL | = | TkCore::INTERP.create_table
Tk_CanvasTag_ID | = | ['ctag'.freeze, '00000'.taint].freeze

### Public Class methods

id2obj(canvas, id)

[Source]

    # File tk/lib/tk/canvastag.rb, line 206
      def TkcTag.id2obj(canvas, id)
        cpath = canvas.path
        return id unless CTagID_TBL[cpath]
        CTagID_TBL[cpath][id]? CTagID_TBL[cpath][id]: id
      end

new(parent, mode=nil, *args)

[Source]

    # File tk/lib/tk/canvastag.rb, line 212
      def initialize(parent, mode=nil, *args)
        #unless parent.kind_of?(TkCanvas)
        #  fail ArgumentError, "expect TkCanvas for 1st argument"
        #end
        @c = parent
        @cpath = parent.path
        # @path = @id = Tk_CanvasTag_ID.join('')
        @path = @id = Tk_CanvasTag_ID.join(TkCore::INTERP._ip_id_)
        CTagID_TBL[@cpath] = {} unless CTagID_TBL[@cpath]
        CTagID_TBL[@cpath][@id] = self
        Tk_CanvasTag_ID[1].succ!
        if mode
          tk_call_without_enc(@c.path, "addtag", @id, mode, *args)
        end
      end

### Public Instance methods

above(target)

Alias for set_to_above

all()

Alias for set_to_all

below(target)

Alias for set_to_below

closest(x, y, halo=None, start=None)

Alias for set_to_closest

delete()

[Source]

    # File tk/lib/tk/canvastag.rb, line 239
      def delete
        @c.delete @id
        CTagID_TBL[@cpath].delete(@id) if CTagID_TBL[@cpath]
        self
      end

destroy()

Alias for delete

enclosed(x1, y1, x2, y2)

Alias for set_to_enclosed

exist?()

[Source]

    # File tk/lib/tk/canvastag.rb, line 231
      def exist?
        if @c.find_withtag(@id)
          true
        else
          false
        end
      end

id()

[Source]

    # File tk/lib/tk/canvastag.rb, line 227
      def id
        @id
      end

overlapping(x1, y1, x2, y2)

Alias for set_to_overlapping

remove()

Alias for delete

set_to_above(target)

[Source]

    # File tk/lib/tk/canvastag.rb, line 247
      def set_to_above(target)
        @c.addtag_above(@id, target)
        self
      end

set_to_all()

[Source]

    # File tk/lib/tk/canvastag.rb, line 253
      def set_to_all
        @c.addtag_all(@id)
        self
      end

set_to_below(target)

[Source]

    # File tk/lib/tk/canvastag.rb, line 259
      def set_to_below(target)
        @c.addtag_below(@id, target)
        self
      end

set_to_closest(x, y, halo=None, start=None)

[Source]

    # File tk/lib/tk/canvastag.rb, line 265
      def set_to_closest(x, y, halo=None, start=None)
        @c.addtag_closest(@id, x, y, halo, start)
        self
      end

set_to_enclosed(x1, y1, x2, y2)

[Source]

    # File tk/lib/tk/canvastag.rb, line 271
      def set_to_enclosed(x1, y1, x2, y2)
        @c.addtag_enclosed(@id, x1, y1, x2, y2)
        self
      end

set_to_overlapping(x1, y1, x2, y2)

[Source]

    # File tk/lib/tk/canvastag.rb, line 277
      def set_to_overlapping(x1, y1, x2, y2)
        @c.addtag_overlapping(@id, x1, y1, x2, y2)
        self
      end

set_to_withtag(target)

[Source]

    # File tk/lib/tk/canvastag.rb, line 283
      def set_to_withtag(target)
        @c.addtag_withtag(@id, target)
        self
      end

withtag(target)

Alias for set_to_withtag

[Validate]