summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Hanne <marius.hanne@sourceagency.org>2013-02-23 19:49:55 +0100
committerMarius Hanne <marius.hanne@sourceagency.org>2013-02-23 20:34:29 +0100
commit02efb6d22f1f1f916d2b5ba514d1d7d66dce7514 (patch)
tree97dacdc7bafa57fd61aedaf0e8c0414ba3301eee
parenta99d63db2009478528e5e6bea59c1cbd926bc4f7 (diff)
downloadffi-efl-02efb6d22f1f1f916d2b5ba514d1d7d66dce7514.zip
ffi-efl-02efb6d22f1f1f916d2b5ba514d1d7d66dce7514.tar.gz
example for ElmPanes (also fixes the class name in elm_panes.rb)
-rw-r--r--lib/efl/elm/elm_panes.rb2
-rw-r--r--test/test_panes.rb73
2 files changed, 74 insertions, 1 deletions
diff --git a/lib/efl/elm/elm_panes.rb b/lib/efl/elm/elm_panes.rb
index 031befe..c0aea86 100644
--- a/lib/efl/elm/elm_panes.rb
+++ b/lib/efl/elm/elm_panes.rb
@@ -8,7 +8,7 @@ module Efl
#
module Elm
#
- class ElmCheck < ElmObject
+ class ElmPanes < ElmObject
#
include Helper
constructor :elm_panes_add
diff --git a/test/test_panes.rb b/test/test_panes.rb
new file mode 100644
index 0000000..db2de03
--- /dev/null
+++ b/test/test_panes.rb
@@ -0,0 +1,73 @@
+#! /usr/bin/env ruby
+# -*- coding: UTF-8 -*-
+#
+require 'efl/elm/elm_win'
+require 'efl/elm/elm_bg'
+require 'efl/elm/elm_panes'
+require 'efl/elm/elm_button'
+#
+include Efl
+#
+class MyWin < Elm::ElmWin
+ #
+ def initialize
+ super(nil, "Greetings") do
+ title_set "Hello, World!"
+ resize 320, 400
+ show
+ end
+ @bg = Elm::ElmBg.new(self) do
+ size_hint_weight_expand
+ show
+ end
+ resize_object_add @bg
+ #
+ @panes = Elm::ElmPanes.new(self) do
+ size_hint_weight_expand
+ size_hint_align_fill
+ show
+ end
+ resize_object_add @panes
+ #
+ @bt1 = Elm::ElmButton.new(self) do
+ part_text_set(nil, "Left")
+ size_hint_weight_expand
+ size_hint_align_fill
+ show
+ end
+ @panes.part_content_set("left", @bt1)
+ #
+ @panes_h = Elm::ElmPanes.new(self) do
+ horizontal_set true
+ size_hint_weight_expand
+ size_hint_align_fill
+ show
+ end
+ @panes.part_content_set("right", @panes_h)
+ #
+ @bt2 = Elm::ElmButton.new(self) do
+ part_text_set(nil, "Up")
+ size_hint_weight_expand
+ size_hint_align_fill
+ show
+ end
+ @panes_h.part_content_set("left", @bt2)
+ #
+ @bt3 = Elm::ElmButton.new(self) do
+ part_text_set(nil, "Down")
+ size_hint_weight_expand
+ size_hint_align_fill
+ show
+ end
+ @panes_h.part_content_set("right", @bt3)
+ end
+end
+#
+Elm.init
+#
+MyWin.new
+#
+Elm.run
+Elm.shutdown
+#
+# EOF