Skip to main content

Module native

Module native 

Source
Expand description

Desktop windows (Windows, macOS, Linux).

Structs§

AppIdentity
Who the app is to the system, for finding its icon and its menu entry.
OpenDialog
The system’s dialog for choosing a file to open.
SaveDialog
The system’s dialog for choosing where to save a file. It asks before replacing a file that exists, so the path it returns can be written.
SystemNotifier
Shows notifications in the system’s own place: the Notification Center on macOS, a toast on Windows and the notification server on Linux, which plain GNOME has even without a tray. Needs the notifications feature.
SystemTray
Keeps the app running beside the clock when its window is closed. Give it to AppIdentity::close_to_tray.
WindowOptions
How the main window opens.

Enums§

PlatformError
Failure to start or run the desktop app.

Functions§

diagnose
Finds the GPU the way a window would and describes it, along with the machine and the build, without showing anything. For a command line option such as --diagnostics, which still answers when a window would not open or would be too slow to use. Printing the result gives text to paste into a bug report.
open_url
Opens a web page in the browser. Only http and https are accepted, so a bad URL cannot end up running a program or opening a file instead.
open_with_system
Opens a file with the program the system uses for it: a PDF in its viewer, a web page in the browser. The program runs on its own, so this does not wait for it.
run
Opens a window showing root and runs until it is closed.
run_as
Like run, for an app the system should recognize as itself.
run_with_icon
Like run, with an icon for the window’s title bar and the task bar on Windows and Linux. macOS takes an app’s icon from its bundle instead.