Skip to content

Commit

Permalink
Adapted also code examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
mvidner committed May 26, 2017
1 parent 8a1e3c4 commit 8be6e64
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion library/cwm/examples/object_api_tree.rb
Expand Up @@ -137,6 +137,18 @@ def true_love_selector
end
end

class ExampleTree < CWM::Tree
attr_reader :items
def initialize(items)
@items = items
end

def label
textdomain "example"
_("It's complicated")
end
end

module Yast
class ExampleDialog
include Yast::I18n
Expand All @@ -151,7 +163,7 @@ def run

tl_item = ::CWM::PagerTreeItem.new(true_love_tab)
ln_item = ::CWM::PagerTreeItem.new(lucky_number_tab, children: [tl_item])
tabs = ::CWM::TreePager.new(ln_item, label: _("It's complicated"))
tabs = ::CWM::TreePager.new(ExampleTree.new([ln_item]))

contents = VBox(tabs)

Expand Down

0 comments on commit 8be6e64

Please sign in to comment.