Differences From Artifact [e754271834]:
- File
src/menus.mm
— part of check-in
[489124a92f]
at
2025-03-16 10:11:39
on branch trunk
— Use one autorelease pool per frame
This way, nowhere else autorelease pools need to be managed. (user: js, size: 3087) [annotate] [blame] [check-ins using]
To Artifact [bd623c6a87]:
- File src/menus.m — part of check-in [b250dfa8d4] at 2025-03-20 21:18:29 on branch trunk — Convert more files to pure Objective-C (user: js, size: 3055) [annotate] [blame] [check-ins using]
- File src/menus.mm — part of check-in [89fbd7a152] at 2025-03-20 13:21:56 on branch trunk — Make more use of convenience methods (user: js, size: 3055) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
91 92 93 94 95 96 97 | void newmenu(OFString *name) { if (menus == nil) menus = [[OFMutableArray alloc] init]; | | | | | | 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | void newmenu(OFString *name) { if (menus == nil) menus = [[OFMutableArray alloc] init]; [menus addObject:[Menu menuWithName:name]]; } COMMAND(newmenu, ARG_1STR) void menumanual(int m, int n, OFString *text) { if (n == 0) [menus[m].items removeAllObjects]; MenuItem *item = [MenuItem itemWithText:text action:@""]; [menus[m].items addObject:item]; } void menuitem(OFString *text, OFString *action) { Menu *menu = menus.lastObject; MenuItem *item = [MenuItem itemWithText:text action:(action.length > 0 ? action : text)]; [menu.items addObject:item]; } COMMAND(menuitem, ARG_2STR) bool menukey(int code, bool isdown) { |
︙ | ︙ |