Class: HotCocoa::PopUpMenuItemList

Inherits:
PopUpItemList show all
Includes:
Enumerable
Defined in:
lib/hotcocoa/mappings/appkit/popup.rb

Instance Attribute Summary

Attributes inherited from PopUpItemList

#control

Instance Method Summary collapse

Methods inherited from PopUpItemList

#<<, #delete, #initialize, #insert, #selected_index, #size

Constructor Details

This class inherits a constructor from HotCocoa::PopUpItemList

Instance Method Details

#[](index) ⇒ Object



71
72
73
# File 'lib/hotcocoa/mappings/appkit/popup.rb', line 71

def [] index
  control.itemAtIndex index
end

#each(&block) ⇒ Object



75
76
77
# File 'lib/hotcocoa/mappings/appkit/popup.rb', line 75

def each &block
  control.itemArray.each &block
end

#selectedObject



59
60
61
# File 'lib/hotcocoa/mappings/appkit/popup.rb', line 59

def selected
  control.selectedItem
end

#selected=(menu_item) ⇒ Object



63
64
65
66
67
68
69
# File 'lib/hotcocoa/mappings/appkit/popup.rb', line 63

def selected= menu_item
  if menu_item.kind_of? Fixnum
    control.selectItemAtIndex menu_item
  else
    control.selectItem menu_item
  end
end