X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=bin%2Fembrace;h=9772596e4280c26e21eeb6148f706d9049379765;hb=16f509dbf97d51232c282cce8c22090435ff3a66;hp=8feccd3aff578921273392d1b24a95de89dbe492;hpb=e4a1763a49c6ad35ab3a93448e5aa1db8aaddead;p=embrace.git diff --git a/bin/embrace b/bin/embrace index 8feccd3..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? @@ -235,6 +227,7 @@ module Embrace def delete_at(i) Kernel.raise(ContainerLockedError) unless @about_to_add.zero? + Kernel.raise(ContainerLockedError) unless @add_lock_count.zero? # icons that are placed above the one that's deleted need # to be moved @@ -357,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?