# File tk/lib/tk/bindtag.rb, line 23 def TkBindTag.id2obj(id) BTagID_TBL.mutex.synchronize{ (BTagID_TBL[id])? BTagID_TBL[id]: id } end
# File tk/lib/tk/bindtag.rb, line 61 def initialize(*args, &b) Tk_BINDTAG_ID.mutex.synchronize{ # @id = Tk_BINDTAG_ID.join('') @id = Tk_BINDTAG_ID.join(TkCore::INTERP._ip_id_) Tk_BINDTAG_ID[1].succ! } BTagID_TBL.mutex.synchronize{ BTagID_TBL[@id] = self } bind(*args, &b) if args != [] end
def ::new_by_name(name, *args, &b)
BTagID_TBL.mutex.synchronize{ return BTagID_TBL[name] if BTagID_TBL[name] } self.new.instance_eval{ BTagID_TBL.mutex.synchronize{ BTagID_TBL.delete @id @id = name BTagID_TBL[@id] = self } bind(*args, &b) if args != [] self }
end
# File tk/lib/tk/bindtag.rb, line 46 def TkBindTag.new_by_name(name, *args, &b) obj = nil BTagID_TBL.mutex.synchronize{ if BTagID_TBL[name] obj = BTagID_TBL[name] else (obj = BTagID_TBL[name] = self.allocate).instance_eval{ @id = name } end } bind(*args, &b) if obj && args != [] obj 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.