Class: Tgui::MenuBar::Item

Inherits:
MenuItem show all
Defined in:
lib/white_gold/dsl/menu_bar.rb

Instance Attribute Summary

Attributes inherited from WidgetLike

#host, #id

Instance Method Summary collapse

Methods inherited from MenuItem

#[], #on_press, #on_press=, #remove_subitems, #text, #text=

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?

Methods included from BangNestedCaller

#bang_method_missing, #bang_object_stack, #bang_respond_to?, #self!, #upon!

Constructor Details

#initialize(menu_bar, path) ⇒ Item

Returns a new instance of Item.



177
178
179
# File 'lib/white_gold/dsl/menu_bar.rb', line 177

def initialize menu_bar, path
  super(menu_bar, path.freeze)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class BangNest

Instance Method Details

#enabled=(enabled) ⇒ Object



182
183
184
185
186
# File 'lib/white_gold/dsl/menu_bar.rb', line 182

def enabled=(enabled)
  host.self_path_block path do
    host._abi_set_menu_item_enabled _1, _2, enabled
  end   
end

#enabled?Boolean

Returns:



188
189
190
191
192
# File 'lib/white_gold/dsl/menu_bar.rb', line 188

def enabled?
  host.self_path_block path do
    host._abi_get_menu_item_enabled _1, _2
  end
end

#pathObject



201
202
203
# File 'lib/white_gold/dsl/menu_bar.rb', line 201

def path
  @id
end

#removeObject



194
195
196
197
198
199
# File 'lib/white_gold/dsl/menu_bar.rb', line 194

def remove
  host.self_path_block path do
    host._abi_remove_menu_item _1, _2
    host.self_tree.cut *_3
  end
end