cocoa: Enable creating empty menu
This commit is contained in:
parent
49ac363eef
commit
af72842728
1 changed files with 7 additions and 4 deletions
|
@ -251,10 +251,13 @@ int EventFlagsFromNSEvent(NSEvent* event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSMenu*)menu {
|
- (NSMenu*)menu {
|
||||||
if (!menu_ && model_) {
|
if (menu_)
|
||||||
menu_.reset([[self menuFromModel:model_] retain]);
|
return menu_.get();
|
||||||
[menu_ setDelegate:self];
|
|
||||||
}
|
menu_.reset([[NSMenu alloc] initWithTitle:@""]);
|
||||||
|
[menu_ setDelegate:self];
|
||||||
|
if (model_)
|
||||||
|
[self populateWithModel:model_];
|
||||||
return menu_.get();
|
return menu_.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue