diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2011-05-01 09:19:01 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2011-05-01 09:19:01 +0200 |
commit | 67b6e2f3cee8b602f87c78bef3963f5832ca1ab6 (patch) | |
tree | 86d7f7a33edae7dffdd33f73c0fb55299ecf386b /test/test_edje.rb | |
parent | f95e9909e93dd1ddb9d19ccd36be34a3a84ddd44 (diff) | |
download | ffi-efl-67b6e2f3cee8b602f87c78bef3963f5832ca1ab6.zip ffi-efl-67b6e2f3cee8b602f87c78bef3963f5832ca1ab6.tar.gz |
add test_edje and data
Diffstat (limited to 'test/test_edje.rb')
-rw-r--r-- | test/test_edje.rb | 47 |
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 |