]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/menuitem.mm
Fix compilation for OSX backend.
[wxWidgets.git] / src / osx / cocoa / menuitem.mm
index 969a11b44c2b67eab48a96574eceec3c9ab45d59..543b64f321fa090b1b8ab05a58531b8c92a09e4a 100644 (file)
@@ -74,8 +74,8 @@ SEL wxOSXGetSelectorFromID(int menuId )
 
 - (id) initWithTitle:(NSString *)aString action:(SEL)aSelector keyEquivalent:(NSString *)charCode
 {
-    [super initWithTitle:aString action:aSelector keyEquivalent:charCode];
-     return self;
+    self = [super initWithTitle:aString action:aSelector keyEquivalent:charCode];
+    return self;
 }
 
 - (void) clickedAction: (id) sender
@@ -328,7 +328,7 @@ wxMenuItemImpl* wxMenuItemImpl::Create( wxMenuItem* peer, wxMenu *pParentMenu,
         wxCFStringRef cfText(text);
         SEL selector = nil;
         bool targetSelf = false;
-        if ( ! pParentMenu->GetNoEventsMode() && pSubMenu == NULL )
+        if ( (pParentMenu == NULL || !pParentMenu->GetNoEventsMode()) && pSubMenu == NULL )
         {
             selector = wxOSXGetSelectorFromID(menuid);