class TkcTag
Constants
- CTagID_TBL
- Tk_CanvasTag_ID
Public Class Methods
Source
# File lib/tk/canvastag.rb, line 234 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
Source
# File lib/tk/canvastag.rb, line 245 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
Source
# File lib/tk/canvastag.rb, line 276 def delete @c.delete @id CTagID_TBL.mutex.synchronize{ CTagID_TBL[@cpath].delete(@id) if CTagID_TBL[@cpath] } self end
Source
# File lib/tk/canvastag.rb, line 268 def exist? if @c.find_withtag(@id) true else false end end
Source
# File lib/tk/canvastag.rb, line 286 def set_to_above(target) @c.addtag_above(@id, target) self end
Also aliased as: above
Source
# File lib/tk/canvastag.rb, line 292 def set_to_all @c.addtag_all(@id) self end
Also aliased as: all
Source
# File lib/tk/canvastag.rb, line 298 def set_to_below(target) @c.addtag_below(@id, target) self end
Also aliased as: below
Source
# File lib/tk/canvastag.rb, line 304 def set_to_closest(x, y, halo=None, start=None) @c.addtag_closest(@id, x, y, halo, start) self end
Also aliased as: closest
Source
# File lib/tk/canvastag.rb, line 310 def set_to_enclosed(x1, y1, x2, y2) @c.addtag_enclosed(@id, x1, y1, x2, y2) self end
Also aliased as: enclosed
Source
# File lib/tk/canvastag.rb, line 316 def set_to_overlapping(x1, y1, x2, y2) @c.addtag_overlapping(@id, x1, y1, x2, y2) self end
Also aliased as: overlapping
Source
# File lib/tk/canvastag.rb, line 322 def set_to_withtag(target) @c.addtag_withtag(@id, target) self end
Also aliased as: withtag