Function · Application Lifecycle
createDesktopApplication
Creates the desktop application lifetime used to open windows and tray icons.
@sharpts/gui · SharpTS 572a2e31be0eSignature
TypeScript
createDesktopApplication(options: DesktopApplicationOptions = {}): DesktopApplicationParameters
| Name | Type | Description |
|---|---|---|
options | DesktopApplicationOptionsDefault: {} | Shutdown, error handling, resource, and style options. |
Returns
DesktopApplication — The live desktop application.
Remarks
Only one desktop application lifetime should be active for a GUI host. Dispose it to release all native windows, tray icons, and resources.
Throws
- When the desktop host is unavailable or the initial resource or style configuration is invalid.
Examples
TypeScript
import { createDesktopApplication, Window } from "@sharpts/gui";
const app = createDesktopApplication();
const window = app.createWindow(<Window title="Hello, SharpTS" />);
window.closed.finally(() => app.dispose());Related symbols
Source
src/SharpTS.Gui.Sdk/GuiPackage/runtime.ts:1187 at SharpTS revision 572a2e31be0e2a09be0138bc44501b34d6245b51.