In Files

  • tk/lib/tk/canvastag.rb

Class/Module Index [+]

Quicksearch

TkcTagAccess

Public Instance Methods

&(tag) click to toggle source

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 172
def & (tag)
  if tag.kind_of? TkObject
    TkcTagString.new(@c, '(' + @id + ')&&(' + tag.path + ')')
  else
    TkcTagString.new(@c, '(' + @id + ')&&(' + tag.to_s + ')')
  end
end
            
-@() click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 196
def -@
  TkcTagString.new(@c, '!(' + @id + ')')
end
            
^(tag) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 188
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) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 15
def addtag(tag)
  @c.addtag(tag, 'withtag', @id)
  self
end
            
bbox() click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 20
def bbox
  @c.bbox(@id)
end
            
bind(seq, *args) click to toggle source

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

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

end

 
               # File tk/lib/tk/canvastag.rb, line 28
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) click to toggle source

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

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

end

 
               # File tk/lib/tk/canvastag.rb, line 43
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) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 54
def bind_remove(seq)
  @c.itembind_remove(@id, seq)
  self
end
            
bindinfo(seq=nil) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 59
def bindinfo(seq=nil)
  @c.itembindinfo(@id, seq)
end
            
cget(option) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 63
def cget(option)
  @c.itemcget(@id, option)
end
            
cget_strict(option) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 66
def cget_strict(option)
  @c.itemcget_strict(@id, option)
end
            
configinfo(key=nil) click to toggle source

def configure(keys)

@c.itemconfigure @id, keys

end

 
               # File tk/lib/tk/canvastag.rb, line 78
def configinfo(key=nil)
  @c.itemconfiginfo(@id, key)
end
            
configure(key, value=None) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 70
def configure(key, value=None)
  @c.itemconfigure(@id, key, value)
  self
end
            
coords(*args) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 86
def coords(*args)
  @c.coords(@id, *args)
end
            
current_configinfo(key=nil) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 82
def current_configinfo(key=nil)
  @c.current_itemconfiginfo(@id, key)
end
            
dchars(first, last=None) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 90
def dchars(first, last=None)
  @c.dchars(@id, first, last)
  self
end
            
deltag(tag_to_del=None) click to toggle source
Alias for: dtag
dtag(tag_to_del=None) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 95
def dtag(tag_to_del=None)
  @c.dtag(@id, tag_to_del)
  self
end
            
Also aliased as: deltag
find() click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 101
def find
  @c.find('withtag', @id)
end
            
Also aliased as: list
focus() click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 106
def focus
  @c.itemfocus(@id)
end
            
gettags() click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 110
def gettags
  @c.gettags(@id)
end
            
icursor(index) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 114
def icursor(index)
  @c.icursor(@id, index)
  self
end
            
index(idx) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 119
def index(idx)
  @c.index(@id, idx)
end
            
insert(beforethis, string) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 123
def insert(beforethis, string)
  @c.insert(@id, beforethis, string)
  self
end
            
itemtype() click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 161
def itemtype
  @c.itemtype(@id)
end
            
list() click to toggle source
Alias for: find
lower(belowthis=None) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 128
def lower(belowthis=None)
  @c.lower(@id, belowthis)
  self
end
            
move(xamount, yamount) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 133
def move(xamount, yamount)
  @c.move(@id, xamount, yamount)
  self
end
            
raise(abovethis=None) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 138
def raise(abovethis=None)
  @c.raise(@id, abovethis)
  self
end
            
scale(xorigin, yorigin, xscale, yscale) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 143
def scale(xorigin, yorigin, xscale, yscale)
  @c.scale(@id, xorigin, yorigin, xscale, yscale)
  self
end
            
select_adjust(index) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 148
def select_adjust(index)
  @c.select('adjust', @id, index)
  self
end
            
select_from(index) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 152
def select_from(index)
  @c.select('from', @id, index)
  self
end
            
select_to(index) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 156
def select_to(index)
  @c.select('to', @id, index)
  self
end
            
|(tag) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 180
def | (tag)
  if tag.kind_of? TkObject
    TkcTagString.new(@c, '(' + @id + ')||(' + tag.path + ')')
  else
    TkcTagString.new(@c, '(' + @id + ')||(' + tag.to_s + ')')
  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.

blog comments powered by Disqus