diff options
| author | Marius Hanne <marius.hanne@sourceagency.org> | 2013-02-23 20:05:57 +0100 | 
|---|---|---|
| committer | Marius Hanne <marius.hanne@sourceagency.org> | 2013-02-23 20:49:45 +0100 | 
| commit | 65813de1b704f7d208665ca216c63fa53d0722d2 (patch) | |
| tree | dddba8f6eb4131d1944ca03244941b7bfeaea575 /test | |
| parent | 4b06d63bab26a79223133b753a13d25347a67022 (diff) | |
| download | ffi-efl-65813de1b704f7d208665ca216c63fa53d0722d2.zip ffi-efl-65813de1b704f7d208665ca216c63fa53d0722d2.tar.gz  | |
example for ElmNaviFrame
Diffstat (limited to 'test')
| -rw-r--r-- | test/test_naviframe.rb | 58 | 
1 files changed, 58 insertions, 0 deletions
diff --git a/test/test_naviframe.rb b/test/test_naviframe.rb new file mode 100644 index 0000000..9350d06 --- /dev/null +++ b/test/test_naviframe.rb @@ -0,0 +1,58 @@ +#! /usr/bin/env ruby +# -*- coding: UTF-8 -*- +# +require 'efl/elm/elm_win' +require 'efl/elm/elm_bg' +require 'efl/elm/elm_button' +require 'efl/elm/elm_naviframe' +# +include Efl +# +class MyWin < Elm::ElmWin +  # +  attr_reader :frames +  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 +    # +    @naviframe = Elm::ElmNaviFrame.new(self) do +      size_hint_weight_expand +      size_hint_align_fill +      show +    end +    resize_object_add @naviframe +    # +    @frames = 0 +    add_frame +  end +  # +  def add_frame *a +    @frames += 1 +    _self = self +    @content = Elm::ElmButton.new(self) do +      text_set "content #{_self.frames}" +      size_hint_weight_expand +      size_hint_align_fill +      smart_callback_add "clicked", _self.method(:add_frame) +      show +    end +    @naviframe.item_push("test #{@frames}", nil, nil, @content, nil) +  end +end +# +Elm.init +# +MyWin.new +# +Elm.run +Elm.shutdown +# +# EOF  | 
