Class: SDL::Mac::Cocoa::NSMenuItem
Class Method Summary
collapse
Instance Method Summary
collapse
#inspect, nsclassname, #nsclassname, #release
Constructor Details
#initialize(*args) ⇒ NSMenuItem
Returns a new instance of NSMenuItem.
356
357
358
359
360
361
362
|
# File 'lib/ruby-sdl-ffi/sdl/mac.rb', line 356
def initialize( *args )
if args.empty?
super( ObjC::NSClass("NSMenuItem").msg_ptr("alloc") )
else
super( args[0] )
end
end
|
Class Method Details
.separatorItem ⇒ Object
352
353
354
|
# File 'lib/ruby-sdl-ffi/sdl/mac.rb', line 352
def self.separatorItem
new( msg_ptr("separatorItem") )
end
|
Instance Method Details
382
383
384
|
# File 'lib/ruby-sdl-ffi/sdl/mac.rb', line 382
def
msg_bool("hasSubmenu")
end
|
#initWithTitle(title, action = nil, keyEquivalent = "") ⇒ Object
364
365
366
367
368
369
370
371
372
|
# File 'lib/ruby-sdl-ffi/sdl/mac.rb', line 364
def initWithTitle( title, action=nil, keyEquivalent="" )
ptr = FFI.find_type(:pointer)
action = ObjC.sel(action) if action.is_a? String
msg( "initWithTitle:action:keyEquivalent:",
ptr, ObjC::NSString(title),
ptr, action,
ptr, ObjC::NSString(keyEquivalent))
self
end
|
386
387
388
|
# File 'lib/ruby-sdl-ffi/sdl/mac.rb', line 386
def
Cocoa::NSMenu( msg_ptr("submenu") ) if
end
|
390
391
392
|
# File 'lib/ruby-sdl-ffi/sdl/mac.rb', line 390
def ( )
msg("setSubmenu:", FFI.find_type(:pointer), )
end
|
#title ⇒ Object
374
375
376
|
# File 'lib/ruby-sdl-ffi/sdl/mac.rb', line 374
def title
msg_str("title")
end
|
#title=(t) ⇒ Object
378
379
380
|
# File 'lib/ruby-sdl-ffi/sdl/mac.rb', line 378
def title=( t )
msg("setTitle:", FFI.find_type(:pointer), ObjC::NSString(t))
end
|