summaryrefslogtreecommitdiffstats
path: root/test/test_edje.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_edje.rb')
-rw-r--r--test/test_edje.rb47
1 files changed, 47 insertions, 0 deletions
diff --git a/test/test_edje.rb b/test/test_edje.rb
new file mode 100644
index 0000000..c63203c
--- /dev/null
+++ b/test/test_edje.rb
@@ -0,0 +1,47 @@
+#! /usr/bin/env ruby
+# -*- coding: UTF-8 -*-
+#
+require 'efl/eina'
+require 'efl/evas'
+require 'efl/ecore'
+require 'efl/ecore_evas'
+require 'efl/edje'
+#
+Efl::Eina::init
+Efl::Evas::init
+Efl::Ecore::init
+Efl::EcoreEvas::init
+Efl::Edje::init
+#
+WIDTH=320
+HEIGHT=240
+EDJE_FILE=File.join File.dirname(__FILE__),'edje_test.edj'
+#
+def create_my_group canvas, txt
+ #edje = edje_object_add(canvas);
+ edje = canvas.edje_object_add
+ if not edje.file_set EDJE_FILE, "my_group"
+ puts "unable to open #{EDJE_FILE}"
+ exit 1
+ end
+ edje.part_text_set "text", txt unless txt.nil?
+ edje.move 0, 0
+ edje.resize WIDTH, HEIGHT
+ edje.show
+ edje
+end
+#
+txt = ( ARGV.length>0 ? ARGV[0] : nil )
+#
+window = Efl::EcoreEvas::REcoreEvas.new { |w|
+ w.resize WIDTH, HEIGHT
+}
+#
+canvas = window.get
+edje = create_my_group canvas, txt
+window.show
+#
+Efl::Ecore.main_loop_begin
+#
+edje.free
+window.free