summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/test_elm_win.rb (renamed from test/test_elm_win_class.rb)26
1 files changed, 14 insertions, 12 deletions
diff --git a/test/test_elm_win_class.rb b/test/test_elm_win.rb
index fb98e71..ed6246a 100644
--- a/test/test_elm_win_class.rb
+++ b/test/test_elm_win.rb
@@ -6,6 +6,7 @@ require 'efl/elementary'
include Efl
#
class MyWin < Elm::ElmWin
+ #
def initialize name, title
super FFI::MemoryPointer::NULL, name
title_set title
@@ -13,19 +14,19 @@ class MyWin < Elm::ElmWin
smart_callback_add "delete,request", method(:exit), FFI::MemoryPointer.from_string("my data")
end
def feed
- # using block
- @bg = add 'bg' do |bg|
+ @bg = Elm::ElmBg.new(self) do |bg|
bg.size_hint_weight_set 1.0, 1.0
- bg.color = 200,255,100,200 # same as bg.color_set 200,255,100,200
+# bg.color = 200,255,100
+ bg.evas_object_color_set 200,255,100,150
bg.show
end
- resize_object_add @bg.to_ptr
- @lb = add 'label'do |lb|
- lb.label_label_set "Hello World!" # complete function name
- lb.size_hint_weight_set 1.0, 1.0 # implicit evas_object function name prefix
+ resize_object_add @bg
+ @lb = Elm::ElmLabel.new(self) do |lb|
+ lb.label_set "Hello World!"
+ lb.size_hint_weight_set 1.0, 1.0
end
@lb.show
- resize_object_add @lb.to_ptr
+ resize_object_add @lb
end
def exit data, evas_object, event_info
puts "EXIT #{data.read_string}"
@@ -35,12 +36,13 @@ end
#
Elm.init
#
-win = MyWin.new "App name", "Window Title" do |w,eo|
+win = MyWin.new "App name", "Window Title" do |w|
w.alpha_set true
- eo.move 300, 300
- eo.resize 200, 100
- eo.show
+ w.move 300, 300
+ w.resize 200, 100
+ w.show
end
+win.show
#
Elm.run
Elm.shutdown