From: Tilman Sauerbeck Date: Thu, 25 May 2006 10:04:02 +0000 (+0200) Subject: use EvasObject#name to identify icons X-Git-Tag: embrace-0.1.0~18 X-Git-Url: http://git.code-monkey.de/?p=embrace.git;a=commitdiff_plain;h=16f509dbf97d51232c282cce8c22090435ff3a66 use EvasObject#name to identify icons --- diff --git a/bin/embrace b/bin/embrace index 2316b0d..9772596 100755 --- a/bin/embrace +++ b/bin/embrace @@ -110,6 +110,8 @@ module Embrace def initialize(evas, label) super(evas) + self.name = label + @slot = nil @alpha_anim = nil @@ -125,16 +127,12 @@ module Embrace @img.set_file(ICON_FILE) @img.set_fill(0, 0, *@img.get_size) - @label.text = label + @label.text = name @label.set_font("VeraBd", 10) resize(*@img.get_size) end - def label - @label.text - end - # smart callbacks def on_show @objects.each { |o| o.show } @@ -175,8 +173,6 @@ module Embrace class ContainerFullError < ContainerError; end class ContainerLockedError < ContainerError; end - include Enumerable - def initialize(evas) super @@ -192,10 +188,6 @@ module Embrace @add_lock_count = 0 end - def each - @icons.compact.each { |i| yield i } - end - def <<(i) Kernel.raise(ContainerFullError) if slots_left.zero? Kernel.raise(ContainerLockedError) unless @add_lock_count.zero? @@ -358,7 +350,7 @@ module Embrace lbl = md.captures.first end - found = @container.find { |i| i.label == lbl } + found = evas.find_object(lbl) begin if ev.count.zero?