From cf346b519a7f2e9b285c32c107b8777b2a13cab0 Mon Sep 17 00:00:00 2001 From: t Date: Wed, 25 Nov 2026 09:04:56 -0700 Subject: 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. --- src/main.zig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/main.zig') 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); -- cgit v1.3