From 16f509dbf97d51232c282cce8c22090435ff3a66 Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Thu, 25 May 2006 12:04:02 +0200 Subject: [PATCH] use EvasObject#name to identify icons --- bin/embrace | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) 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? -- 2.30.2