vendor/assets/application/examples/unfasten.rb in atome-0.5.7.3.9 vs vendor/assets/application/examples/unfasten.rb in atome-0.5.7.4.2
- old
+ new
@@ -1,17 +1,23 @@
# frozen_string_literal: true
-
-
-b = box({ drag: true, id: :the_b })
+b = box({ drag: true, id: :the_b, top: 63, left: 63 })
c = b.circle({ left: 99, id: :the_c })
-t = b.text({ data: :hello, left: 44, top: 44, id: :the_t })
+b.box({left: 99, top: 99, width: 33, height: 33, id: :second_one})
+t = b.text({ data: 'touch the circle', left: 44, top: 44, id: :the_t })
c.touch(:down) do
b.unfasten([c.id])
b.color(:green)
t.data('circle unfasten')
- wait 3 do
- b.color(:red)
- t.data('unfasten all attached atomes')
- b.unfasten(:all)
+ grab(:infos).data("number of item(s) fasten to the box : #{b.fasten}")
+ wait 2 do
+ grab(:second_one).delete((true))
+ grab(:infos).data("number of item(s) fasten to the box : #{b.fasten}")
+ wait 2 do
+ b.color(:red)
+ t.data('unfasten all attached atomes')
+ b.unfasten(:all)
+ grab(:infos).data("number of item fasten to the box : #{b.fasten}")
+ end
end
+end
-end
\ No newline at end of file
+text({id: :infos,left: 155, data: "number of item fasten to the box : #{b.fasten}"})