In Files

  • tk/lib/tk/canvastag.rb

Class/Module Index [+]

Quicksearch

TkcTag

Public Class Methods

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

Public Instance Methods

above(target) click to toggle source
Alias for: set_to_above
all() click to toggle source
Alias for: set_to_all
below(target) click to toggle source
Alias for: set_to_below
closest(x, y, halo=None, start=None) click to toggle source
Alias for: set_to_closest
delete() click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 284
def delete
  @c.delete @id
  CTagID_TBL.mutex.synchronize{
    CTagID_TBL[@cpath].delete(@id) if CTagID_TBL[@cpath]
  }
  self
end
            
Also aliased as: remove, destroy
destroy() click to toggle source
Alias for: delete
enclosed(x1, y1, x2, y2) click to toggle source
Alias for: set_to_enclosed
exist?() click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 276
def exist?
  if @c.find_withtag(@id)
    true
  else
    false
  end
end
            
id() click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 272
def id
  @id
end
            
mutex() click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 234
def mutex; @mutex; end
            
overlapping(x1, y1, x2, y2) click to toggle source
Alias for: set_to_overlapping
remove() click to toggle source
Alias for: delete
set_to_above(target) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 294
def set_to_above(target)
  @c.addtag_above(@id, target)
  self
end
            
Also aliased as: above
set_to_all() click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 300
def set_to_all
  @c.addtag_all(@id)
  self
end
            
Also aliased as: all
set_to_below(target) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 306
def set_to_below(target)
  @c.addtag_below(@id, target)
  self
end
            
Also aliased as: below
set_to_closest(x, y, halo=None, start=None) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 312
def set_to_closest(x, y, halo=None, start=None)
  @c.addtag_closest(@id, x, y, halo, start)
  self
end
            
Also aliased as: closest
set_to_enclosed(x1, y1, x2, y2) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 318
def set_to_enclosed(x1, y1, x2, y2)
  @c.addtag_enclosed(@id, x1, y1, x2, y2)
  self
end
            
Also aliased as: enclosed
set_to_overlapping(x1, y1, x2, y2) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 324
def set_to_overlapping(x1, y1, x2, y2)
  @c.addtag_overlapping(@id, x1, y1, x2, y2)
  self
end
            
Also aliased as: overlapping
set_to_withtag(target) click to toggle source
 
               # File tk/lib/tk/canvastag.rb, line 330
def set_to_withtag(target)
  @c.addtag_withtag(@id, target)
  self
end
            
Also aliased as: withtag
withtag(target) click to toggle source
Alias for: set_to_withtag

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.