Class: UI::ListRow
Instance Attribute Summary
Attributes inherited from View
#alpha, #background_color, #border_color, #border_radius, #border_width
Attributes inherited from CSSNode
#align_items, #align_self, #border_bottom_width, #border_end, #border_left_width, #border_right_width, #border_start, #border_top_width, #border_width, #bottom, #flex, #flex_direction, #flex_wrap, #height, #justify_content, #left, #margin, #margin_bottom, #margin_end, #margin_left, #margin_right, #margin_start, #margin_top, #max_height, #max_width, #min_height, #min_width, #name, #padding, #padding_bottom, #padding_end, #padding_left, #padding_right, #padding_start, #padding_top, #position, #right, #top, #width
Instance Method Summary (collapse)
-
- (ListRow) initialize
constructor
A new instance of ListRow.
- - (Object) update(data)
Methods inherited from View
#hidden=, #hidden?, #proxy, #update_layout
Methods inherited from CSSNode
#add_child, #children, #delete_child, #parent, #root, set_scale
Constructor Details
- (ListRow) initialize
Returns a new instance of ListRow
4 5 6 7 8 9 10 11 12 13 |
# File 'flow/ui/list_row.rb', line 4 def initialize super self.flex_direction = :row @label = UI::Label.new @label.flex = 1 @label.margin = [10, 15] @label.padding = 5 self.add_child(@label) end |
Instance Method Details
- (Object) update(data)
15 16 17 |
# File 'flow/ui/list_row.rb', line 15 def update(data) @label.text = data end |