# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1626133898 0 # Node ID 4671ac4ad3c6e7c49232df3a400fcb19a0105789 # Parent 592f3003f8532eb395a75b05addd78b2530ac731 iOS: Had to switch from UIKeyCommand to UIAction for DWMenuItem. UIKeyCommand would be preferable, but it won't add more than one menu item per selector, so we could only have one item on our menus. UIAction allows us to call the selector manually in a closure, but there is no UIKeyAction class that I can find... revisit this later if something changes. diff -r 592f3003f853 -r 4671ac4ad3c6 ios/dw.m --- a/ios/dw.m Mon Jul 12 21:51:12 2021 +0000 +++ b/ios/dw.m Mon Jul 12 23:51:38 2021 +0000 @@ -656,7 +656,7 @@ @end API_AVAILABLE(ios(13.0)) -@interface DWMenuItem : UIKeyCommand +@interface DWMenuItem : UIAction { BOOL check, enabled; unsigned long tag; @@ -7605,7 +7605,7 @@ HWND API dw_menu_append_item(HMENUI menux, const char *title, ULONG itemid, ULONG flags, int end, int check, HMENUI submenux) { DWMenu *menu = menux; - DWMenuItem *item = nil; + __block DWMenuItem *item = nil; if(!title || strlen(title) == 0) [menu addItem:[[NSNull alloc] init]]; else @@ -7620,11 +7620,10 @@ nstr = [NSString stringWithUTF8String:newtitle]; free(newtitle); - item = [[DWMenuItem commandWithTitle:nstr image:nil - action:@selector(menuHandler:) - input:[NSString stringWithUTF8String:accel] - modifierFlags:UIKeyModifierCommand - propertyList:nil] autorelease]; + item = [[DWMenuItem actionWithTitle:nstr image:nil identifier:nil + handler:^(__kindof UIAction * _Nonnull action) { + [DWObj menuHandler:item]; + }] autorelease]; /* Don't set the tag if the ID is 0 or -1 */ if(itemid != DW_MENU_AUTO && itemid != DW_MENU_POPUP) [item setTag:itemid];