Module TkcTagAccess
In: tk/lib/tk/canvastag.rb

Methods

&   -@   ^   addtag   bbox   bind   bind_append   bind_remove   bindinfo   cget   configinfo   configure   coords   current_configinfo   dchars   dtag   find   focus   gettags   icursor   index   insert   itemtype   list   lower   move   raise   scale   select_adjust   select_from   select_to   |  

Included Modules

TkComm TkTreatTagFont

Public Instance methods

Following operators support logical expressions of canvas tags (for Tk8.3+). If tag1.path is ‘t1’ and tag2.path is ‘t2’, then

     ltag = tag1 & tag2; ltag.path => "(t1)&&(t2)"
     ltag = tag1 | tag2; ltag.path => "(t1)||(t2)"
     ltag = tag1 ^ tag2; ltag.path => "(t1)^(t2)"
     ltag = - tag1;      ltag.path => "!(t1)"

[Source]

# File tk/lib/tk/canvastag.rb, line 148
  def & (tag)
    if tag.kind_of? TkObject
      TkcTagString.new(@c, '(' + @id + ')&&(' + tag.path + ')')
    else
      TkcTagString.new(@c, '(' + @id + ')&&(' + tag.to_s + ')')
    end
  end

[Source]

# File tk/lib/tk/canvastag.rb, line 172
  def -@
    TkcTagString.new(@c, '!(' + @id + ')')
  end

[Source]

# File tk/lib/tk/canvastag.rb, line 164
  def ^ (tag)
    if tag.kind_of? TkObject
      TkcTagString.new(@c, '(' + @id + ')^(' + tag.path + ')')
    else
      TkcTagString.new(@c, '(' + @id + ')^(' + tag.to_s + ')')
    end
  end

[Source]

# File tk/lib/tk/canvastag.rb, line 15
  def addtag(tag)
    @c.addtag(tag, 'with', @id)
    self
  end

[Source]

# File tk/lib/tk/canvastag.rb, line 20
  def bbox
    @c.bbox(@id)
  end

[Source]

# File tk/lib/tk/canvastag.rb, line 24
  def bind(seq, cmd=Proc.new, *args)
    @c.itembind(@id, seq, cmd, *args)
    self
  end

[Source]

# File tk/lib/tk/canvastag.rb, line 29
  def bind_append(seq, cmd=Proc.new, *args)
    @c.itembind_append(@id, seq, cmd, *args)
    self
  end

[Source]

# File tk/lib/tk/canvastag.rb, line 34
  def bind_remove(seq)
    @c.itembind_remove(@id, seq)
    self
  end

[Source]

# File tk/lib/tk/canvastag.rb, line 39
  def bindinfo(seq=nil)
    @c.itembindinfo(@id, seq)
  end

[Source]

# File tk/lib/tk/canvastag.rb, line 43
  def cget(option)
    @c.itemcget(@id, option)
  end

def configure(keys)

  @c.itemconfigure @id, keys

end

[Source]

# File tk/lib/tk/canvastag.rb, line 55
  def configinfo(key=nil)
    @c.itemconfiginfo(@id, key)
  end

[Source]

# File tk/lib/tk/canvastag.rb, line 47
  def configure(key, value=None)
    @c.itemconfigure(@id, key, value)
    self
  end

[Source]

# File tk/lib/tk/canvastag.rb, line 63
  def coords(*args)
    @c.coords(@id, *args)
  end

[Source]

# File tk/lib/tk/canvastag.rb, line 59
  def current_configinfo(key=nil)
    @c.current_itemconfiginfo(@id, key)
  end

[Source]

# File tk/lib/tk/canvastag.rb, line 67
  def dchars(first, last=None)
    @c.dchars(@id, first, last)
    self
  end

[Source]

# File tk/lib/tk/canvastag.rb, line 72
  def dtag(tag_to_del=None)
    @c.dtag(@id, tag_to_del)
    self
  end

[Source]

# File tk/lib/tk/canvastag.rb, line 77
  def find
    @c.find('withtag', @id)
  end

[Source]

# File tk/lib/tk/canvastag.rb, line 82
  def focus
    @c.itemfocus(@id)
  end

[Source]

# File tk/lib/tk/canvastag.rb, line 86
  def gettags
    @c.gettags(@id)
  end

[Source]

# File tk/lib/tk/canvastag.rb, line 90
  def icursor(index)
    @c.icursor(@id, index)
    self
  end

[Source]

# File tk/lib/tk/canvastag.rb, line 95
  def index(index)
    @c.index(@id, index)
  end

[Source]

# File tk/lib/tk/canvastag.rb, line 99
  def insert(beforethis, string)
    @c.insert(@id, beforethis, string)
    self
  end

[Source]

# File tk/lib/tk/canvastag.rb, line 137
  def itemtype
    @c.itemtype(@id)
  end
list()

Alias for find

[Source]

# File tk/lib/tk/canvastag.rb, line 104
  def lower(belowthis=None)
    @c.lower(@id, belowthis)
    self
  end

[Source]

# File tk/lib/tk/canvastag.rb, line 109
  def move(xamount, yamount)
    @c.move(@id, xamount, yamount)
    self
  end

[Source]

# File tk/lib/tk/canvastag.rb, line 114
  def raise(abovethis=None)
    @c.raise(@id, abovethis)
    self
  end

[Source]

# File tk/lib/tk/canvastag.rb, line 119
  def scale(xorigin, yorigin, xscale, yscale)
    @c.scale(@id, xorigin, yorigin, xscale, yscale)
    self
  end

[Source]

# File tk/lib/tk/canvastag.rb, line 124
  def select_adjust(index)
    @c.select('adjust', @id, index)
    self
  end

[Source]

# File tk/lib/tk/canvastag.rb, line 128
  def select_from(index)
    @c.select('from', @id, index)
    self
  end

[Source]

# File tk/lib/tk/canvastag.rb, line 132
  def select_to(index)
    @c.select('to', @id, index)
    self
  end

[Source]

# File tk/lib/tk/canvastag.rb, line 156
  def | (tag)
    if tag.kind_of? TkObject
      TkcTagString.new(@c, '(' + @id + ')||(' + tag.path + ')')
    else
      TkcTagString.new(@c, '(' + @id + ')||(' + tag.to_s + ')')
    end
  end

[Validate]