Class: MG::List
- Defined in:
- doc/API_reference.rb
Properties collapse
-
#items_margin ⇒ Float
The margin between items in the list.
Attributes inherited from Scroll
#direction, #inner_container, #inner_size
Attributes inherited from Layout
#background_color, #clipping?, #type
Attributes inherited from Widget
#enabled?, #highlighted?, #touch_enabled?
Attributes inherited from Node
#alpha, #anchor_point, #color, #name, #position, #rotation, #scale, #size, #visible?, #z_index
Constructors collapse
-
#initialize ⇒ List
constructor
Creates a new List widget.
Managing Items collapse
-
#add_item(widget) ⇒ List
Adds a new item to the end of the list.
-
#clear_items ⇒ List
Removes all items in the list.
-
#delete_item(index) ⇒ List
Deletes the item at the given index.
-
#insert_item(index, widget) ⇒ List
Inserts a new item at the given index in the list.
-
#item_at(index) ⇒ Widget
Retrieves the item at the given index.
Selection collapse
-
#on_selection {|Integer| ... } ⇒ List
Configures a block to be called when an item is selected in the list view.
-
#selected_item ⇒ Integer
The index of the currently selected item.
Methods inherited from Widget
Methods inherited from Node
#add, #children, #clear, #delete, #delete_from_parent, #intersects?, #parent, #run_action, #stop_action, #stop_all_actions
Constructor Details
#initialize ⇒ List
Creates a new List widget.
1314 |
# File 'doc/API_reference.rb', line 1314 def initialize; end |
Instance Attribute Details
#items_margin ⇒ Float
Returns the margin between items in the list.
1360 1361 1362 |
# File 'doc/API_reference.rb', line 1360 def items_margin @items_margin end |
Instance Method Details
#add_item(widget) ⇒ List
Adds a new item to the end of the list.
1322 |
# File 'doc/API_reference.rb', line 1322 def add_item(); end |
#clear_items ⇒ List
Removes all items in the list.
1342 |
# File 'doc/API_reference.rb', line 1342 def clear_items; end |
#delete_item(index) ⇒ List
Deletes the item at the given index.
1338 |
# File 'doc/API_reference.rb', line 1338 def delete_item(index); end |
#insert_item(index, widget) ⇒ List
Inserts a new item at the given index in the list.
1328 |
# File 'doc/API_reference.rb', line 1328 def insert_item(index, ); end |
#item_at(index) ⇒ Widget
Retrieves the item at the given index.
1333 |
# File 'doc/API_reference.rb', line 1333 def item_at(index); end |
#on_selection {|Integer| ... } ⇒ List
Configures a block to be called when an item is selected in the list view.
1351 |
# File 'doc/API_reference.rb', line 1351 def on_selection; end |
#selected_item ⇒ Integer
Returns the index of the currently selected item.
1354 |
# File 'doc/API_reference.rb', line 1354 def selected_item; end |