diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-25 15:13:14 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-25 15:13:14 +0000 |
commit | d0233291bc8a5068e52c69c210e5979e5324b5bc (patch) | |
tree | 7d9459449c33792c63eeb7baa071e76352e0baab /trunk/ext/tk/lib/tk/bindtag.rb | |
parent | 0dc342de848a642ecce8db697b8fecd83a63e117 (diff) | |
parent | 72eaacaa15256ab95c3b52ea386f88586fb9da40 (diff) |
re-adding tag v1_9_0_4 as an alias of trunk@18848v1_9_0_4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_9_0_4@18849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'trunk/ext/tk/lib/tk/bindtag.rb')
-rw-r--r-- | trunk/ext/tk/lib/tk/bindtag.rb | 138 |
1 files changed, 0 insertions, 138 deletions
diff --git a/trunk/ext/tk/lib/tk/bindtag.rb b/trunk/ext/tk/lib/tk/bindtag.rb deleted file mode 100644 index 88c8367a88..0000000000 --- a/trunk/ext/tk/lib/tk/bindtag.rb +++ /dev/null @@ -1,138 +0,0 @@ -# -# tk/bind.rb : control event binding -# -require 'tk' - -class TkBindTag - include TkBindCore - - #BTagID_TBL = {} - BTagID_TBL = TkCore::INTERP.create_table - - (Tk_BINDTAG_ID = ["btag".freeze, "00000".taint]).instance_eval{ - @mutex = Mutex.new - def mutex; @mutex; end - freeze - } - - TkCore::INTERP.init_ip_env{ - BTagID_TBL.mutex.synchronize{ BTagID_TBL.clear } - } - - def TkBindTag.id2obj(id) - BTagID_TBL.mutex.synchronize{ - (BTagID_TBL[id])? BTagID_TBL[id]: id - } - end - -=begin - def TkBindTag.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 -=end - 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 - - 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 - - ALL = self.new_by_name('all') - - def name - @id - end - - def to_eval - @id - end - - def inspect - #Kernel.format "#<TkBindTag: %s>", @id - '#<TkBindTag: ' + @id + '>' - end -end - - -class TkBindTagAll<TkBindTag - def TkBindTagAll.new(*args, &b) - $stderr.puts "Warning: TkBindTagALL is obsolete. Use TkBindTag::ALL\n" - - TkBindTag::ALL.bind(*args, &b) if args != [] - TkBindTag::ALL - end -end - - -class TkDatabaseClass<TkBindTag -=begin - def self.new(name, *args, &b) - BTagID_TBL.mutex.synchronize{ - return BTagID_TBL[name] if BTagID_TBL[name] - } - super(name, *args, &b) - end - - def initialize(name, *args, &b) - @id = name - BTagID_TBL.mutex.synchronize{ - BTagID_TBL[@id] = self - } - bind(*args, &b) if args != [] - end -=end - def self.new(name, *args, &b) - BTagID_TBL.mutex.synchronize{ - if BTagID_TBL[name] - BTagID_TBL[name] - else - BTagID_TBL[name] = self.allocate.instance_eval{ - initialize(name, *args, &b) - self - } - end - } - end - - def initialize(name, *args, &b) - @id = name - bind(*args, &b) if args != [] - end - - def inspect - #Kernel.format "#<TkDatabaseClass: %s>", @id - '#<TkDatabaseClass: ' + @id + '>' - end -end |