Start managed macOS AppKit client
.NET port / test (macos-latest) (push) Canceled after 0s
.NET port / test (ubuntu-24.04) (push) Canceled after 0s
.NET port / test (windows-latest) (push) Canceled after 0s
.NET port / apple-client (push) Canceled after 0s
.NET port / cpp-conformance (push) Canceled after 0s
.NET port / test (macos-latest) (push) Canceled after 0s
.NET port / test (ubuntu-24.04) (push) Canceled after 0s
.NET port / test (windows-latest) (push) Canceled after 0s
.NET port / apple-client (push) Canceled after 0s
.NET port / cpp-conformance (push) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
using AppKit;
|
||||
using Foundation;
|
||||
|
||||
namespace VoiceCat.Mac;
|
||||
|
||||
internal sealed class AppDelegate : NSApplicationDelegate
|
||||
{
|
||||
private ConnectWindowController? connect;
|
||||
public override void DidFinishLaunching(NSNotification notification)
|
||||
{
|
||||
NSApplication.SharedApplication.ActivationPolicy = NSApplicationActivationPolicy.Regular;
|
||||
BuildMenu();
|
||||
connect = new(); connect.ShowWindow(this);
|
||||
NSApplication.SharedApplication.ActivateIgnoringOtherApps(true);
|
||||
}
|
||||
public override bool ApplicationShouldTerminateAfterLastWindowClosed(NSApplication sender) => true;
|
||||
private static void BuildMenu()
|
||||
{
|
||||
var menu = new NSMenu(); var root = new NSMenuItem(); menu.AddItem(root);
|
||||
var application = new NSMenu(); application.AddItem(new NSMenuItem("Quit VoiceCat", "q", (_, _) => NSApplication.SharedApplication.Terminate(null)));
|
||||
root.Submenu = application; NSApplication.SharedApplication.MainMenu = menu;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user