Class: Tgui::ComboBox::Item
Instance Attribute Summary
Attributes inherited from WidgetLike
#host, #id
Instance Method Summary
collapse
Methods inherited from WidgetLike
abi_attr, abi_bit_enum, abi_def, abi_enum, #flags=, self_abi_def, self_abi_def_setter, self_abi_def_setter_with_id, self_abi_def_with_id, self_packers_id_extend
Methods included from BangDef
#def!
Methods included from BangNest
#method_missing, #respond_to?
#bang_method_missing, #bang_object_stack, #bang_respond_to?, #self!, #upon!
Constructor Details
#initialize(combo_box, id) ⇒ Item
Returns a new instance of Item.
61
62
63
64
|
# File 'lib/white_gold/dsl/combo_box.rb', line 61
def initialize combo_box, id
@combo_box = combo_box
@id = id
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class BangNest
Instance Method Details
70
71
72
|
# File 'lib/white_gold/dsl/combo_box.rb', line 70
def object
return @combo_box.self_objects[@id]
end
|
#object=(object) ⇒ Object
66
67
68
|
# File 'lib/white_gold/dsl/combo_box.rb', line 66
def object=(object)
@combo_box.self_objects[@id] = object
end
|
#selected=(selected) ⇒ Object
82
83
84
85
86
87
88
|
# File 'lib/white_gold/dsl/combo_box.rb', line 82
def selected=(selected)
if selected
@combo_box.selected = object
else
@combo_box.deselect if selected?
end
end
|
90
91
92
|
# File 'lib/white_gold/dsl/combo_box.rb', line 90
def selected?
@combo_box.selected == object
end
|
78
79
80
|
# File 'lib/white_gold/dsl/combo_box.rb', line 78
def text
abi_unpack_string(@combo_box._abi_get_item_by_id abi_pack_string(@id))
end
|
#text=(text) ⇒ Object
74
75
76
|
# File 'lib/white_gold/dsl/combo_box.rb', line 74
def text=(text)
@combo_box._abi_change_item_by_id abi_pack_string(@id), abi_pack_string(text)
end
|