GPUI.Application behaviour (gpui v0.2.0-rc.1)

Copy Markdown View Source

Behaviour and DSL for OTP-supervised GPUI applications.

mount/1 declares a session's initial windows. Interactive state belongs to each root view's assigns rather than an unused application-level state value. Window blocks may bind stable command IDs with shortcut/2; native and remote displays dispatch them to the same view handlers used by buttons and menus.

Summary

Callbacks

Builds the initial renderer-independent window set for a session.

Functions

Declares whether the window uses system or application-rendered content chrome.

Returns and validates an application's declared identity, when present.

Declares a minimum window size inside window.

Declares whether the native window can be resized by the user.

Declares a root view inside window.

Binds an application command to a modified shortcut inside window.

Declares a window size inside window.

Builds a window specification from a DSL block.

Builds a keyed window specification from a DSL block.

Callbacks

identity()

(optional)
@callback identity() :: GPUI.Application.Identity.t()

mount(term)

@callback mount(term()) :: {:ok, [GPUI.WindowSpec.t()]}

Builds the initial renderer-independent window set for a session.

Functions

chrome(value)

(macro)

Declares whether the window uses system or application-rendered content chrome.

identity(app)

@spec identity(module()) :: GPUI.Application.Identity.t() | nil

Returns and validates an application's declared identity, when present.

min_size(width, height)

(macro)

Declares a minimum window size inside window.

resizable(value)

(macro)

Declares whether the native window can be resized by the user.

root(module, assigns \\ [])

(macro)

Declares a root view inside window.

shortcut(id, keys)

(macro)

Binds an application command to a modified shortcut inside window.

size(width, height)

(macro)

Declares a window size inside window.

window(title, list)

(macro)

Builds a window specification from a DSL block.

window(key, title, list)

(macro)

Builds a keyed window specification from a DSL block.