summaryrefslogtreecommitdiffstats
path: root/test/test_evas.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-02-27 11:37:06 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2012-02-27 11:37:06 +0100
commit7603f4c0902bf5845c7e7654c3745f5519347c8b (patch)
treebd381bf3a7f04d2ee7ddd92111c35a03472c7ecf /test/test_evas.rb
parent8c013976d73850718e75bbc93a03f3f016fc3ae8 (diff)
downloadffi-efl-7603f4c0902bf5845c7e7654c3745f5519347c8b.zip
ffi-efl-7603f4c0902bf5845c7e7654c3745f5519347c8b.tar.gz
use instance_eval instead of yield self.
- simplify and highlights initialization code - but shadows external scope variables
Diffstat (limited to 'test/test_evas.rb')
-rw-r--r--test/test_evas.rb24
1 files changed, 12 insertions, 12 deletions
diff --git a/test/test_evas.rb b/test/test_evas.rb
index c3eadf7..c70f4d9 100644
--- a/test/test_evas.rb
+++ b/test/test_evas.rb
@@ -59,19 +59,19 @@ h = 240
#
canvas, pixels = create_canvas w, h
#
-bg = canvas.object_rectangle_add do |b|
- b.color = 255, 255, 255, 255
- b.move 0, 0
- b.resize w, h
+bg = canvas.object_rectangle_add do
+ color_set 255, 255, 255, 255
+ move 0, 0
+ resize w, h
end
bg.show
#
draw_scene canvas
#
-r1 = canvas.object_rectangle_add do |r|
- r.color = 255, 0, 0, 255
- r.move 10, 10
- r.resize 100, 100
+r1 = canvas.object_rectangle_add do
+ color_set 0, 0, 0, 255
+ move 10, 10
+ resize 100, 100
end
r1.show
#
@@ -82,10 +82,10 @@ r2 = canvas.object_rectangle_add do |r|
end
r2.show
#
-r3 = canvas.object_rectangle_add do |r|
- r.color = 0, 128, 0, 255
- r.move 60, 60
- r.resize 50, 50
+r3 = canvas.object_rectangle_add do
+ color_set 0, 128, 0, 255
+ move 60, 60
+ resize 50, 50
end
r3.show
#