class SDL::Mac::Cocoa::NSMenu
Public Class Methods
new( *args )
click to toggle source
Calls superclass method
# File lib/ruby-sdl-ffi/sdl/mac.rb, line 287 def initialize( *args ) if args.empty? super( ObjC::NSClass("NSMenu").msg_ptr("alloc") ) else super( args[0] ) end end
Public Instance Methods
[](index)
click to toggle source
# File lib/ruby-sdl-ffi/sdl/mac.rb, line 337 def [](index) Cocoa::NSMenuItem( msg_ptr("itemAtIndex:", FFI.find_type(:long), index) ) end
addItem( item )
click to toggle source
# File lib/ruby-sdl-ffi/sdl/mac.rb, line 308 def addItem( item ) msg("addItem:", FFI.find_type(:pointer), item) self end
addItemWithTitle( title, action=nil, keyEquivalent="" )
click to toggle source
# File lib/ruby-sdl-ffi/sdl/mac.rb, line 313 def addItemWithTitle( title, action=nil, keyEquivalent="" ) ptr = FFI.find_type(:pointer) action = ObjC.sel(action) if action.is_a? String item = msg_ptr( "addItemWithTitle:action:keyEquivalent:", ptr, ObjC::NSString(title), ptr, action, ptr, ObjC::NSString(keyEquivalent)) NSMenuItem.new(item) end
each() { |self| ... }
click to toggle source
# File lib/ruby-sdl-ffi/sdl/mac.rb, line 341 def each length.times{ |i| yield self[i] } end
initWithTitle( title )
click to toggle source
# File lib/ruby-sdl-ffi/sdl/mac.rb, line 295 def initWithTitle( title ) msg( "initWithTitle:", FFI.find_type(:pointer), ObjC::NSString(title) ) self end
length()
click to toggle source
# File lib/ruby-sdl-ffi/sdl/mac.rb, line 333 def length msg_int( "numberOfItems" ) end
removeItem( item )
click to toggle source
# File lib/ruby-sdl-ffi/sdl/mac.rb, line 323 def removeItem( item ) msg("removeItem:", FFI.find_type(:pointer), item) self end
removeItemAtIndex( index )
click to toggle source
# File lib/ruby-sdl-ffi/sdl/mac.rb, line 328 def removeItemAtIndex( index ) msg("removeItemAtIndex:", FFI.find_type(:long), index) self end
title()
click to toggle source
# File lib/ruby-sdl-ffi/sdl/mac.rb, line 300 def title msg_str("title") end
title=( t )
click to toggle source
# File lib/ruby-sdl-ffi/sdl/mac.rb, line 304 def title=( t ) msg("setTitle:", FFI.find_type(:pointer), ObjC::NSString(t)) end