Module: TkcTagAccess (Ruby 2.3.4)

In Files

  • tk/lib/tk/canvastag.rb

Class/Module Index [+]

Quicksearch

TkcTagAccess

Public Instance Methods

&(tag)

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)"
 
               # File tk/lib/tk/canvastag.rb, line 198
def & (tag)
  if tag.kind_of? TkObject
    TkcTagString.new(@c, '(' + @id + ')&&(' + tag.path + ')')
  else
    TkcTagString.new(@c, '(' + @id + ')&&(' + tag.to_s + ')')
  end
end
            
-@()
 
               # File tk/lib/tk/canvastag.rb, line 222
def -@
  TkcTagString.new(@c, '!(' + @id + ')')
end
            
^(tag)
 
               # File tk/lib/tk/canvastag.rb, line 214
def ^ (tag)
  if tag.kind_of? TkObject
    TkcTagString.new(@c, '(' + @id + ')^(' + tag.path + ')')
  else
    TkcTagString.new(@c, '(' + @id + ')^(' + tag.to_s + ')')
  end
end
            
addtag(tag)
 
               # File tk/lib/tk/canvastag.rb, line 16
def addtag(tag)
  @c.addtag(tag, 'withtag', @id)
  self
end
            
bbox()
 
               # File tk/lib/tk/canvastag.rb, line 21
def bbox
  @c.bbox(@id)
end
            
bind(seq, *args)

def bind(seq, cmd=Proc.new, *args)

@c.itembind(@id, seq, cmd, *args)
self

end

 
               # File tk/lib/tk/canvastag.rb, line 29
def bind(seq, *args)
  # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
  if TkComm._callback_entry?(args[0]) || !block_given?
    cmd = args.shift
  else
    cmd = Proc.new
  end
  @c.itembind(@id, seq, cmd, *args)
  self
end
            
bind_append(seq, *args)

def #bind_append(seq, cmd=Proc.new, *args)

@c.itembind_append(@id, seq, cmd, *args)
self

end

 
               # File tk/lib/tk/canvastag.rb, line 44
def bind_append(seq, *args)
  # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
  if TkComm._callback_entry?(args[0]) || !block_given?
    cmd = args.shift
  else
    cmd = Proc.new
  end
  @c.itembind_append(@id, seq, cmd, *args)
  self
end
            
bind_remove(seq)
 
               # File tk/lib/tk/canvastag.rb, line 55
def bind_remove(seq)
  @c.itembind_remove(@id, seq)
  self
end
            
bindinfo(seq=nil)
 
               # File tk/lib/tk/canvastag.rb, line 60
def bindinfo(seq=nil)
  @c.itembindinfo(@id, seq)
end
            
cget(option)
 
               # File tk/lib/tk/canvastag.rb, line 67
def cget(option)
  @c.itemcget(@id, option)
end
            
cget_strict(option)
 
               # File tk/lib/tk/canvastag.rb, line 70
def cget_strict(option)
  @c.itemcget_strict(@id, option)
end
            
cget_tkstring(option)
 
               # File tk/lib/tk/canvastag.rb, line 64
def cget_tkstring(option)
  @c.itemcget_tkstring(@id, option)
end
            
configinfo(key=nil)

def configure(keys)

@c.itemconfigure @id, keys

end

 
               # File tk/lib/tk/canvastag.rb, line 82
def configinfo(key=nil)
  @c.itemconfiginfo(@id, key)
end
            
configure(key, value=None)
 
               # File tk/lib/tk/canvastag.rb, line 74
def configure(key, value=None)
  @c.itemconfigure(@id, key, value)
  self
end
            
coords(*args)
 
               # File tk/lib/tk/canvastag.rb, line 90
def coords(*args)
  @c.coords(@id, *args)
end
            
current_configinfo(key=nil)
 
               # File tk/lib/tk/canvastag.rb, line 86
def current_configinfo(key=nil)
  @c.current_itemconfiginfo(@id, key)
end
            
dchars(first, last=None)
 
               # File tk/lib/tk/canvastag.rb, line 94
def dchars(first, last=None)
  @c.dchars(@id, first, last)
  self
end
            
deltag(tag_to_del=None)
Alias for: dtag
dtag(tag_to_del=None)
 
               # File tk/lib/tk/canvastag.rb, line 99
def dtag(tag_to_del=None)
  @c.dtag(@id, tag_to_del)
  self
end
            
Also aliased as: deltag
find()
 
               # File tk/lib/tk/canvastag.rb, line 105
def find
  @c.find('withtag', @id)
end
            
Also aliased as: list
focus()
 
               # File tk/lib/tk/canvastag.rb, line 110
def focus
  @c.itemfocus(@id)
end
            
gettags()
 
               # File tk/lib/tk/canvastag.rb, line 114
def gettags
  @c.gettags(@id)
end
            
i_move(idx, x, y)
Alias for: imove
icursor(index)
 
               # File tk/lib/tk/canvastag.rb, line 118
def icursor(index)
  @c.icursor(@id, index)
  self
end
            
imove(idx, x, y)
 
               # File tk/lib/tk/canvastag.rb, line 123
def imove(idx, x, y)
  # Tcl/Tk 8.6 or later
  @c.imove(@id, idx, x, y)
  self
end
            
Also aliased as: i_move
index(idx)
 
               # File tk/lib/tk/canvastag.rb, line 130
def index(idx)
  @c.index(@id, idx)
end
            
insert(beforethis, string)
 
               # File tk/lib/tk/canvastag.rb, line 134
def insert(beforethis, string)
  @c.insert(@id, beforethis, string)
  self
end
            
itemtype()
 
               # File tk/lib/tk/canvastag.rb, line 187
def itemtype
  @c.itemtype(@id)
end
            
list()
Alias for: find
lower(belowthis=None)
 
               # File tk/lib/tk/canvastag.rb, line 139
def lower(belowthis=None)
  @c.lower(@id, belowthis)
  self
end
            
move(xamount, yamount)
 
               # File tk/lib/tk/canvastag.rb, line 144
def move(xamount, yamount)
  @c.move(@id, xamount, yamount)
  self
end
            
move_to(x, y)
Alias for: moveto
moveto(x, y)
 
               # File tk/lib/tk/canvastag.rb, line 149
def moveto(x, y)
  # Tcl/Tk 8.6 or later
  @c.moveto(@id, x, y)
  self
end
            
Also aliased as: move_to
raise(abovethis=None)
 
               # File tk/lib/tk/canvastag.rb, line 156
def raise(abovethis=None)
  @c.raise(@id, abovethis)
  self
end
            
rchars(first, last, str_or_coords)
 
               # File tk/lib/tk/canvastag.rb, line 166
def rchars(first, last, str_or_coords)
  # Tcl/Tk 8.6 or later
  @c.rchars(@id, first, last, str_or_coords)
  self
end
            
Also aliased as: replace_chars, replace_coords
replace_chars(first, last, str_or_coords)
Alias for: rchars
replace_coords(first, last, str_or_coords)
Alias for: rchars
scale(xorigin, yorigin, xscale, yscale)
 
               # File tk/lib/tk/canvastag.rb, line 161
def scale(xorigin, yorigin, xscale, yscale)
  @c.scale(@id, xorigin, yorigin, xscale, yscale)
  self
end
            
select_adjust(index)
 
               # File tk/lib/tk/canvastag.rb, line 174
def select_adjust(index)
  @c.select('adjust', @id, index)
  self
end
            
select_from(index)
 
               # File tk/lib/tk/canvastag.rb, line 178
def select_from(index)
  @c.select('from', @id, index)
  self
end
            
select_to(index)
 
               # File tk/lib/tk/canvastag.rb, line 182
def select_to(index)
  @c.select('to', @id, index)
  self
end
            
|(tag)
 
               # File tk/lib/tk/canvastag.rb, line 206
def | (tag)
  if tag.kind_of? TkObject
    TkcTagString.new(@c, '(' + @id + ')||(' + tag.path + ')')
  else
    TkcTagString.new(@c, '(' + @id + ')||(' + tag.to_s + ')')
  end
end