std::window::macos
std::window::macos is the macOS-specific facade for applications that want to
select the macOS provider explicitly while still using the portable
std::window types.
Exported API#
module std::window::macos;
import std::window;
export fn is_supported () -> bool;
export fn open (options: std::window::Options) -> std::window::WindowResult;
Semantics#
is_supported()returnstrueonly when the runtime selectedstd::window::Backend::MacOS.open(...)delegates tostd::window::open(...)after checking that the macOS provider is active.- On non-macOS targets,
open(...)returnsErr(UnsupportedPlatform).
Current provider
- The module is linkable, opts reachable
std::windowexecutables into theAppKitframework, andopen(...)creates a visible provider-ownedNSWindowon macOS targets. - The portable
std::window::next_event(...)call pumps at most one AppKit event, updates AppKit windows, and reportsCloseRequestedwhen the provider-ownedNSWindowis no longer visible. poll(...)remains available as a compatibility liveness/update helper, andclose(...)closes the provider-ownedNSWindow.std::windownative controls route to AppKit for title, visibility, focus, size, position, minimize/maximize/restore, always-on-top, screen size, and background color.- The portable
std::window::run(...)entrypoint opens a visible AppKit window and runs the application event loop until the user closes the last window. - The portable
std::window::run_loop(...)entrypoint owns open/event/close lifecycle for frame-rendering examples and calls the application callback while the AppKit window remains open.
Source repository · Edit this page · View Markdown