Closed EssGeeEich closed 1 year ago
Looks like a good start, thanks
I was just working on macOS for this and it seems like the parent parameter is not needed. The following code worked in my tests:
- (void) add_separator:(NSNumber*) menuID
{
NSMenuItem* menuItem = find_menu_item(menu, menuID);
if (menuItem != NULL) {
[menuItem.submenu addItem: [NSMenuItem separatorItem]];
} else {
[menu addItem: [NSMenuItem separatorItem]];
}
}
(FYI there are Darwin compile errors in the current code, but using the above, and returning the C function to:
void add_separator(int menuId, int parentId) {
NSNumber *pId = [NSNumber numberWithInt:parentId];
runInMainThread(@selector(add_separator:), (id)pId);
}
fixes it :).
I completed this but couldn't push onto this PR, so I included the commit as the base of #41 - hopefully we can get it in v2.3.2.
Closing in favour of #41
This fixes bug #39 on Windows.
Not being familiar with Darwin, I have made some changes that I believe make sense, but they need a double-check. Moreover, I didn't dig deep with Linux since I'm currently unable to test.
TODO: