Class: MG::List
- Defined in:
- doc/API_reference.rb
Instance Attribute Summary collapse
-
#items_margin ⇒ Float
The margin between items in the list.
Attributes inherited from Scroll
#direction, #inner_container, #inner_size
Attributes inherited from Layout
Attributes inherited from Node
#alpha, #anchor_point, #color, #name, #position, #rotation, #scale, #size, #z_index
Constructors collapse
-
#initialize ⇒ List
constructor
Creates a new List widget.
Managing Items collapse
-
#add_item(widget) ⇒ self
Adds a new item to the end of the list.
-
#clear_items ⇒ self
Removes all items in the list.
-
#delete_item(index) ⇒ self
Deletes the item at the given index.
-
#insert_item(index, widget) ⇒ self
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| ... } ⇒ self
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 Scroll
#jump_to_bottom, #jump_to_bottom_left, #jump_to_bottom_right, #jump_to_left, #jump_to_right, #jump_to_top, #jump_to_top_left, #jump_to_top_right
Methods inherited from Layout
#<<, #add, #clipping=, #clipping?
Methods inherited from Widget
#enabled=, #enabled?, #highlighted=, #highlighted?, #on_touch, #touch_enabled=, #touch_enabled?
Methods inherited from Node
#add, #children, #clear, #delete, #delete_from_parent, #intersects?, #number_of_running_actions, #parent, #run_action, #schedule, #schedule_once, #stop_action, #stop_all_actions, #unschedule, #visible=, #visible?
Constructor Details
#initialize ⇒ List
Creates a new List widget.
1720 |
# File 'doc/API_reference.rb', line 1720 def initialize; end |
Instance Attribute Details
#items_margin ⇒ Float
Returns the margin between items in the list.
1766 1767 1768 |
# File 'doc/API_reference.rb', line 1766 def items_margin @items_margin end |
Instance Method Details
#add_item(widget) ⇒ self
Adds a new item to the end of the list.
1728 |
# File 'doc/API_reference.rb', line 1728 def add_item(); end |
#clear_items ⇒ self
Removes all items in the list.
1748 |
# File 'doc/API_reference.rb', line 1748 def clear_items; end |
#delete_item(index) ⇒ self
Deletes the item at the given index.
1744 |
# File 'doc/API_reference.rb', line 1744 def delete_item(index); end |
#insert_item(index, widget) ⇒ self
Inserts a new item at the given index in the list.
1734 |
# File 'doc/API_reference.rb', line 1734 def insert_item(index, ); end |
#item_at(index) ⇒ Widget
Retrieves the item at the given index.
1739 |
# File 'doc/API_reference.rb', line 1739 def item_at(index); end |
#on_selection {|Integer| ... } ⇒ self
Configures a block to be called when an item is selected in the list view.
1757 |
# File 'doc/API_reference.rb', line 1757 def on_selection; end |
#selected_item ⇒ Integer
Returns the index of the currently selected item.
1760 |
# File 'doc/API_reference.rb', line 1760 def selected_item; end |