Documentation
On this page

Function · Application Lifecycle

createDesktopApplication

Creates the desktop application lifetime used to open windows and tray icons.

@sharpts/gui · SharpTS 572a2e31be0e

Signature

TypeScript
createDesktopApplication(options: DesktopApplicationOptions = {}): DesktopApplication

Parameters

NameTypeDescription
optionsDesktopApplicationOptions
Default: {}
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());

Source

src/SharpTS.Gui.Sdk/GuiPackage/runtime.ts:1187 at SharpTS revision 572a2e31be0e2a09be0138bc44501b34d6245b51.