Skip to content

API Reference / @gtkx/runtime / createApplication

Variable: createApplication

const createApplication: <T, P>(base, props) => T

Defined in: packages/runtime/dist/application-class.d.ts:35

Constructs an application GTKX can shut down. GLib parses an application's command line at most once per instance and crashes on a second parse, so runApplication and quitApplication only accept an application built here.

Whatever g_application_constructed assigned to the process-wide default is handed straight back, so merely building an application never makes it what Gio.Application.getDefault() returns. runApplication is the only place that claims that default, which keeps it pointing at an application GTKX has actually started rather than at one that is still unregistered.

Type Parameters

T

T extends CommandLineApplication

P

P

Parameters

base

ApplicationClass<T, P>

The application class to construct, such as Gtk.Application.

props

P

Construct properties, passed through unchanged.

Returns

T

An instance of a class derived from base, registered once per base class as its own GType.

Released under the MPL-2.0 License.