Class: Nuklear::UI::Group

Inherits:
Base
  • Object
show all
Includes:
Container
Defined in:
lib/nuklear/ui/group.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Container

#<<, #commands, #find, #layout_row_dynamic, #method_missing, #run_command, #run_commands, #traverse, #ui_checkbox, #ui_color_picker, #ui_combo, #ui_edit_focus, #ui_edit_string, #ui_layout_row_begin, #ui_layout_row_dynamic, #ui_layout_row_push, #ui_layout_row_static, #ui_layout_row_template_begin, #ui_layout_row_template_dynamic, #ui_layout_row_template_end, #ui_layout_row_template_static, #ui_layout_row_template_variable, #ui_layout_space_begin, #ui_layout_space_end, #ui_layout_space_push, #ui_layout_widget_bounds, #ui_menu_item, #ui_option, #ui_selectable, #ui_window_close

Methods inherited from Base

descendants, #dsl, inherited

Methods included from Enableable

#disable, #disabled=, #disabled?, #enable, #enabled=, #enabled?

Methods included from Events

#event_listeners_for, #on, #trigger

Constructor Details

#initialize(title = object_id.to_s, **options) ⇒ Group

Returns a new instance of Group.



8
9
10
11
12
# File 'lib/nuklear/ui/group.rb', line 8

def initialize(title = object_id.to_s, **options)
  super(**options)
  @scroll_x = @scroll_y = 0
  self.title = title
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Nuklear::UI::Container

Instance Attribute Details

#scroll_xObject

Returns the value of attribute scroll_x.



6
7
8
# File 'lib/nuklear/ui/group.rb', line 6

def scroll_x
  @scroll_x
end

#scroll_yObject

Returns the value of attribute scroll_y.



6
7
8
# File 'lib/nuklear/ui/group.rb', line 6

def scroll_y
  @scroll_y
end

#titleObject

Returns the value of attribute title.



6
7
8
# File 'lib/nuklear/ui/group.rb', line 6

def title
  @title
end

Instance Method Details

#flagsObject



18
19
20
# File 'lib/nuklear/ui/group.rb', line 18

def flags
  0
end

#result(new_state, context) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/nuklear/ui/group.rb', line 22

def result(new_state, context)
  if new_state.kind_of?(Array)
    @scroll_x, @scroll_y = new_state
  else
    run_commands(context)
  end
end

#to_commandObject



14
15
16
# File 'lib/nuklear/ui/group.rb', line 14

def to_command
  [ :ui_group, title, flags, scroll_x, scroll_y ]
end