diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2011-04-21 11:58:01 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2011-04-21 11:58:01 +0200 |
commit | a16b6aa23e7b03512b08df23f7512ee16b56fc17 (patch) | |
tree | 7ca4defe1eb2a10138437b0ffbefc6a887c1a591 /test/elm_win_class.rb | |
parent | eca9cca97c1389804e9ad325d4cf878d0dbc9259 (diff) | |
download | ffi-efl-a16b6aa23e7b03512b08df23f7512ee16b56fc17.zip ffi-efl-a16b6aa23e7b03512b08df23f7512ee16b56fc17.tar.gz |
update ElmWin and test
Diffstat (limited to 'test/elm_win_class.rb')
-rw-r--r-- | test/elm_win_class.rb | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/test/elm_win_class.rb b/test/elm_win_class.rb index dad9b4e..4dae894 100644 --- a/test/elm_win_class.rb +++ b/test/elm_win_class.rb @@ -10,30 +10,34 @@ puts Elm.init class MyWin < Elm::ElmWin def initialize name, title super FFI::MemoryPointer::NULL, name - win_title_set title + title_set title feed - Efl::API.evas_object_smart_callback_add @ptr, "delete,request", method(:exit), FFI::MemoryPointer::NULL + smart_callback_add "delete,request", method(:exit) end def feed - @bg = add 'bg' - Efl::API.evas_object_size_hint_weight_set @bg, 1.0, 1.0 - resize_object_add @bg - Efl::API.evas_object_show @bg - @lb = add 'label' - Efl::API.elm_label_label_set @lb, "Hello World!" - Efl::API.evas_object_size_hint_weight_set @lb, 1.0, 1.0 - resize_object_add @lb - Efl::API.evas_object_show @lb + @bg = add 'bg' do |bg| + bg.size_hint_weight_set 1.0, 1.0 + bg.show + end + resize_object_add @bg.ptr + @lb = add 'label'do |lb| + lb.elm_label_label_set "Hello World!" + lb.size_hint_weight_set 1.0, 1.0 + lb.show + end + resize_object_add @lb.ptr end def exit *args + puts "EXIT" Efl::API.elm_exit(); end end # win = MyWin.new "App name", "Window Title" do |w| - Efl::API.evas_object_move w.ptr, 300, 300 - Efl::API.evas_object_resize w.ptr, 200, 100 - Efl::API.evas_object_show w.ptr + eo = w.evas_object + eo.move 300, 300 + eo.resize 200, 100 + eo.show end Elm.run |