MonobjcMonobjc Documented Class Library
MenuUpdateItemAtIndexShouldCancel Method (menu, item, index, shouldCancel)
NamespacesMonobjc.AppKitINSMenuDelegateMenuUpdateItemAtIndexShouldCancel(NSMenu, NSMenuItem, NSInteger, Boolean)

Invoked to let the delegate update a menu item before it is displayed.

Original signature is '- (BOOL)menu:(NSMenu *)menu updateItem:(NSMenuItem *)item atIndex:(NSInteger)index shouldCancel:(BOOL)shouldCancel'

Available in Mac OS X v10.3 and later.

Declaration Syntax
C#Visual BasicVisual C++
bool MenuUpdateItemAtIndexShouldCancel(
	NSMenu menu,
	NSMenuItem item,
	NSInteger index,
	bool shouldCancel
)
Function MenuUpdateItemAtIndexShouldCancel ( _
	menu As NSMenu, _
	item As NSMenuItem, _
	index As NSInteger, _
	shouldCancel As Boolean _
) As Boolean
bool MenuUpdateItemAtIndexShouldCancel(
	NSMenu^ menu, 
	NSMenuItem^ item, 
	NSInteger index, 
	bool shouldCancel
)
Parameters
menu (NSMenu)
The menu object that owns item.
item (NSMenuItem)
The menu-item object that may be updated.
index (NSInteger)
The integer index of the menu item.
shouldCancel (Boolean)
Set to YES if, due to some user action, the menu no longer needs to be displayed before all the menu items have been updated. You can ignore this flag, return YES, and continue; or you can save your work (to save time the next time your delegate is called) and return NO to stop the updating.
Return Value
YES to continue the process. If you return NO, your menu:updateItem:atIndex:shouldCancel: is not called again. In that case, it is your responsibility to trim any extra items from the menu.
Version Information
  • Available in Monobjc Bridge: 10.6 (For Mac OS X 10.6 and later), 10.5 (For Mac OS X 10.5 and later)

Assembly: Monobjc.AppKit (Module: Monobjc.AppKit)