diff options
-rw-r--r-- | lib/efl/elementary.rb | 9 | ||||
-rw-r--r-- | spec/elm_spec.rb | 30 |
2 files changed, 39 insertions, 0 deletions
diff --git a/lib/efl/elementary.rb b/lib/efl/elementary.rb index b97ab50..2cf2a02 100644 --- a/lib/efl/elementary.rb +++ b/lib/efl/elementary.rb @@ -64,6 +64,15 @@ module Efl end end # + class ElmPager < Efl::Evas::REvasObject + # + search_prefixes 'elm_pager_' + # + def initialize parent, &block + super Native.method(:elm_pager_add), parent, &block + end + end + end end # diff --git a/spec/elm_spec.rb b/spec/elm_spec.rb index 54019a5..b5d5140 100644 --- a/spec/elm_spec.rb +++ b/spec/elm_spec.rb @@ -129,5 +129,35 @@ describe Efl::Elm do @lb.slide_duration.should == 3.1415926 end end + describe Efl::Elm::ElmPager do + # + before(:all) { + realize_app + @p = Elm::ElmPager.new @win + @os = [] + 0.upto(3) do + @os << @win.evas.object_rectangle_add + end + } + after(:all) { + @p.free + @bg.free + @win.free + } + # + it "content push pop promote bottom_get top_get" do + @os.each do |o| + @p.content_push o + end + @p.content_top_get.should == @os[-1].to_ptr + @p.content_bottom_get.should == @os[0].to_ptr + @p.content_pop + @p.content_top_get.should == @os[-2].to_ptr + @p.content_bottom_get.should == @os[0].to_ptr + @p.content_promote @os[0] + @p.content_top_get.should == @os[0].to_ptr + @p.content_bottom_get.should == @os[1].to_ptr + end + end end |