diff options
| author | t <t@tjp.lol> | 2026-11-25 09:04:56 -0700 |
|---|---|---|
| committer | t <t@tjp.lol> | 2026-11-25 09:41:17 -0700 |
| commit | cf346b519a7f2e9b285c32c107b8777b2a13cab0 (patch) | |
| tree | 776798c526e665211f1548385ba42179bc6b7211 /src/main.zig | |
| parent | 2f1d226f6baaafec34b5b3623ba6c9df9aaa003b (diff) | |
Pin libpantograph, target macOS 13, and add an About dialog
Fetch libpantograph from Codeberg by commit and hash, so a clone can build
without a sibling checkout. Always target arm64 macOS 13 instead of the build
machine, whose own version would otherwise become the minimum. Copy the
version from build.zig.zon into Info.plist, where the standard About panel
reads it, and run the app from inside its bundle so that it has one.
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.zig b/src/main.zig index 91d611e..9854bf5 100644 --- a/src/main.zig +++ b/src/main.zig @@ -2566,6 +2566,8 @@ fn menus(app: id) void { const cs = Mod.ctrl | Mod.shift; const m_app = submenu(bar, "Write_Away"); + item(m_app, "About Write_Away", "orderFrontStandardAboutPanel:", "", 0, null); // Info.plist has the version + msg(void, m_app, "addItem:", .{msg(id, objc.class("NSMenuItem"), "separatorItem", .{})}); item(m_app, "Inferenceā¦", "inference:", ",", Mod.cmd, ctl); item(m_app, "Hide Write_Away", "hide:", "h", Mod.cmd, null); item(m_app, "Quit Write_Away", "terminate:", "q", Mod.cmd, null); @@ -2933,7 +2935,11 @@ fn selftest() void { const trim_draft = "We really need this today. Keep my note."; load(trim_draft); _ = msg(bool, window, "makeFirstResponder:", .{page}); - const write_menu = msg(id, msg(id, msg(id, msg(id, objc.class("NSApplication"), "sharedApplication", .{}), "mainMenu", .{}), "itemAtIndex:", .{@as(isize, 3)}), "submenu", .{}); + const shared = msg(id, objc.class("NSApplication"), "sharedApplication", .{}); + const app_menu = msg(id, msg(id, msg(id, shared, "mainMenu", .{}), "itemAtIndex:", .{@as(isize, 0)}), "submenu", .{}); + const about = msg(id, app_menu, "itemWithTitle:", .{str("About Write_Away")}); + t.expect(about != null and msg(bool, shared, "respondsToSelector:", .{msg(SEL, about, "action", .{})}), "the app answers About Write_Away"); + const write_menu = msg(id, msg(id, msg(id, shared, "mainMenu", .{}), "itemAtIndex:", .{@as(isize, 3)}), "submenu", .{}); const next_item = msg(id, write_menu, "itemWithTitle:", .{str("Lab: Next")}); t.expect(next_item != null and !validateMenuItem(null, null, next_item), "Lab review menu is disabled without a review"); toggleTools(null, null, null); |
