Module: CWM::ItemsSelection
- Included in:
- ComboBox, MenuButton, MultiSelectionBox, RadioButtons, SelectionBox
- Defined in:
- library/cwm/src/lib/cwm/common_widgets.rb
Overview
A mix-in to define items used by widgets that offer a selection from a list of values.
Instance Method Summary collapse
-
#change_items(items_list) ⇒ void
Change the list of items offered in widget.
- #cwm_definition ⇒ WidgetHash
-
#items ⇒ Array<Array(String,String)>
Items are defined as a list of pairs, where the first one is the ID and the second one is the user visible value.
Instance Method Details
#change_items(items_list) ⇒ void
This method returns an undefined value.
Change the list of items offered in widget. The format is the same as in #items
79 80 81 82 83 |
# File 'library/cwm/src/lib/cwm/common_widgets.rb', line 79 def change_items(items_list) val = items_list.map { |i| Item(Id(i[0]), i[1]) } Yast::UI.ChangeWidget(Id(), :Items, val) end |
#cwm_definition ⇒ WidgetHash
69 70 71 72 73 |
# File 'library/cwm/src/lib/cwm/common_widgets.rb', line 69 def cwm_definition super.merge( "items" => items ) end |
#items ⇒ Array<Array(String,String)>
Items are defined as a list of pairs, where the first one is the ID and the second one is the user visible value
64 65 66 |
# File 'library/cwm/src/lib/cwm/common_widgets.rb', line 64 def items [] end |