Windows & Native Services
Create windows after app.whenReady(). Each window has its own UI root.
#Window lifetime
new Window({
title: "My App",
width: 720,
height: 480,
renderer: createRenderer(App),
});onClose and on("closed", ...) run after the window is gone. onCloseRequested can hold a close so you can ask the user to save. whenReady() resolves after the native window exists, including hidden windows.
Handle the Dock icon with app.on("reopen", ...) and open a window when hasVisibleWindows is false.
#Commands and services
import { app, Clipboard, Dialog, Menu, Shell, Screen } from "@quickgui/native";
await app.whenReady();
const displays = await Screen.getAllDisplays();
const selected = await Dialog.showOpenDialog({ properties: ["openDirectory"] });Calls that return a value are promises. Menus, file dialogs, clipboard, appearance, notifications, and tray icons are available from @quickgui/native. See Tray Icon.
#Events and file watching
Window events include focus, resize, appearance, minimize, fullscreen, and close. Application events include ready, reopen, activation, quit, and open URLs. Use Bun file watching for project files, and stop watchers in onCleanup when they belong to a window.
