diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2013-02-23 21:55:31 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2013-02-23 21:55:31 +0100 |
commit | e417bd57d7c213f2a50a94ec8690ae76c7f0ebba (patch) | |
tree | a58cf76c782c7c3a13457347fa362b60a66184b6 /test/test_panel.rb | |
parent | 90ae47e71fb3d7179a703bcc344c284e468f59da (diff) | |
parent | 08de292b856e0e182db831ee7a6348695a19c103 (diff) | |
download | ffi-efl-e417bd57d7c213f2a50a94ec8690ae76c7f0ebba.zip ffi-efl-e417bd57d7c213f2a50a94ec8690ae76c7f0ebba.tar.gz |
Merge pull request #6 from mhanne/examples
Some more examples
Diffstat (limited to 'test/test_panel.rb')
-rw-r--r-- | test/test_panel.rb | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/test/test_panel.rb b/test/test_panel.rb new file mode 100644 index 0000000..ac04894 --- /dev/null +++ b/test/test_panel.rb @@ -0,0 +1,87 @@ +#! /usr/bin/env ruby +# -*- coding: UTF-8 -*- +# +require 'efl/elm/elm_win' +require 'efl/elm/elm_bg' +require 'efl/elm/elm_box' +require 'efl/elm/elm_panel' +require 'efl/elm/elm_label' +# +include Efl +# +class MyWin < Elm::ElmWin + # + def initialize + super(nil, "Greetings") do + title_set "Hello, World!" + resize 240, 400 + show + end + @bg = Elm::ElmBg.new(self) do + size_hint_weight_expand + show + end + resize_object_add @bg + # + @bx = Elm::ElmBox.new(self) do + horizontal_set false + size_hint_weight_expand + size_hint_align_fill + show + end + resize_object_add @bx + # + @panel1 = Elm::ElmPanel.new(self) do + orient_set :elm_panel_orient_top + toggle + size_hint_weight_expand + size_hint_align_fill + show + end + @bx.pack_end @panel1 + # + @content = Elm::ElmLabel.new(self) do + text_set "content 1" + show + end + @panel1.content_set @content + # + @panel2 = Elm::ElmPanel.new(self) do + orient_set :elm_panel_orient_right + hidden_set true + size_hint_weight_expand + size_hint_align_fill + show + end + @bx.pack_end @panel2 + # + @content = Elm::ElmLabel.new(self) do + text_set "content 2" + show + end + @panel2.content_set @content + # + @panel3 = Elm::ElmPanel.new(self) do + orient_set :elm_panel_orient_bottom + size_hint_weight_expand + size_hint_align_fill + show + end + @bx.pack_end @panel3 + # + @content = Elm::ElmLabel.new(self) do + text_set "content 3" + show + end + @panel3.content_set @content + end +end +# +Elm.init +# +MyWin.new +# +Elm.run +Elm.shutdown +# +# EOF |