with-ui ( quot: ( -- ) -- )
Factor handbook > UI framework > Starting the UI


Vocabulary
ui

Inputs and outputs
quota quotation with stack effect ( -- )


Word description
Calls the quotation, starting the UI if necessary. If starting the UI is necessary, this word does not return and the UI will start after the quotation returns.

While the combinator is running, ui-running? can be used by user code to determine whether it is running in a UI context or not.

Notes
This word should be used in the MAIN: word of an application that uses the UI in order for the vocabulary to work when run from either the UI listener ("my-app" run) and the command line (./factor -run=my-app).

Examples
The hello-ui vocabulary implements a simple UI application which uses this word.

Definition