summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-05-12 16:43:07 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-05-12 16:43:07 +0200
commit87942d170929746283aa56482c35ddfec02edce1 (patch)
tree4bf18ab581d42486b6a51bf87f21a59f1c7f017f
parent0d7f365d97ae05cdab23529a03ed2f5468ba382a (diff)
downloadffi-efl-87942d170929746283aa56482c35ddfec02edce1.zip
ffi-efl-87942d170929746283aa56482c35ddfec02edce1.tar.gz
update README example
-rw-r--r--README.rdoc41
1 files changed, 33 insertions, 8 deletions
diff --git a/README.rdoc b/README.rdoc
index 1c4a53f..abf77d9 100644
--- a/README.rdoc
+++ b/README.rdoc
@@ -12,17 +12,42 @@ A ruby-ffi binding to efl libraries (Enlightenment Foundation Libraries).
== SYNOPSIS:
- require 'efl'
- Efl::Eet.init
- Efl::Eet::REetFile.open('/tmp/_eet.cfg', :eet_file_mode_write) do |f|
- f.write 'config2', 'test--key'
+ require 'efl/elementary'
+
+ Efl::Elm.init
+
+ on_exit = Proc.new do |data, evas_object, event_info|
+ puts "EXIT #{data.read_string}"
+ Efl::Elm.exit
end
- Efl::Eet::REetFile.open('/tmp/_eet.cfg', :eet_file_mode_read) do |f|
- puts f.read('config2')
+
+ win = Efl::Elm::ElmWin.new nil, "Window name" do |w|
+ w.title = "My title"
+ w.alpha = true
+ w.move 300, 300
+ w.resize 200, 100
+ bg = Efl::Elm::ElmBg.new w do |bg|
+ bg.size_hint_weight_expand
+ bg.size_hint_align_fill
+ bg.evas_object_color_set 200,255,100,150
+ bg.show
+ end
+ w.resize_object_add bg
+ lb = Efl::Elm::ElmLabel.new w do |lb|
+ lb.label_set "Hello World!"
+ lb.size_hint_weight_set 1.0, 1.0
+ end
+ lb.show
+ w.resize_object_add lb
+ w.smart_callback_add "delete,request", on_exit, FFI::MemoryPointer.from_string("my data")
end
- Efl::Eet.shutdown
-For less minimalistic and more sane examples you may look at:
+ win.show
+
+ Efl::Elm.run
+ Efl::Elm.shutdown
+
+For more examples you may look at:
* the spec/ and test/ folders