GUI Application
37 nodes
On this page 37
Make GUI Application
FunctionThis node carries no documentation.
GUIApplication() -> GUI Application
GUIApplication GUIApplication()
Returns
| GUI Application | GUI Application |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Add Button
FunctionAdd a button. Pressing it delivers its intent to the Clicked callback.
AddButton
GUI Application: GUI Application
text: Text
intent: Text
kind: Button Kind
name: Textvoid AddButton(
GUIApplication GUI Application,
string text,
string intent,
ButtonKind kind = ButtonKind.Secondary,
string name)Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — | |
| text | Text | — | The caption. |
| intent | Text | — | What pressing it means. The caption, unless the graph says otherwise - so a keypad's "7" means "7" with nothing more said, and a button captioned "Go" can mean "Start Run". |
| kind | Button Kind | Secondary | How it looks, which says how important it is. |
| name | Text | — | A name, so the button can be reached afterwards. The intent, unless the graph says otherwise. |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Add Divider
FunctionAdd a hairline rule.
AddDivider(GUI Application: GUI Application)
void AddDivider(GUIApplication GUI Application)
Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Add Label
FunctionAdd a line of text.
AddLabel
GUI Application: GUI Application
text: Text
name: Text
role: Label Role
alignment: Text Alignmentvoid AddLabel(
GUIApplication GUI Application,
string text = "",
string name,
LabelRole role = LabelRole.Body,
TextAlignment alignment = TextAlignment.Left)Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — | |
| text | Text | — | What it says. |
| name | Text | — | A name, so the text can be changed afterwards with Set Text. |
| role | Label Role | Body | How prominent it is. |
| alignment | Text Alignment | Left | Where the text sits in the room it has. |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Add Spacer
FunctionAdd empty room: a fixed number of pixels, or with no size, whatever room is free.
AddSpacer(GUI Application: GUI Application, size: Number)
void AddSpacer(GUIApplication GUI Application, double size = 0)
Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — | |
| size | Number | 0 | Pixels, or 0 to take the free room in a column or row. |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Add Text Box
FunctionAdd a line of text the person can edit. Read it back with Get Text.
AddTextBox
GUI Application: GUI Application
name: Text
text: Text
placeholder: Text
intent: Textvoid AddTextBox(
GUIApplication GUI Application,
string name,
string text = "",
string placeholder = "",
string intent)Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — | |
| name | Text | — | A name; a text box exists to be read, so it always has one. |
| text | Text | — | What it starts out saying. |
| placeholder | Text | — | A hint shown while it is empty. |
| intent | Text | — | What pressing Enter in it means, delivered to Clicked exactly as a button's press is - give a box and its button the same intent, and Enter and the button do one thing, written once. Empty, and Enter in it reaches nothing. |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Begin Card
FunctionOpen a card: a raised surface with an optional heading, holding its children in a column.
BeginCard
GUI Application: GUI Application
title: Text
subtitle: Text
name: Textvoid BeginCard(
GUIApplication GUI Application,
string title,
string subtitle,
string name)Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — | |
| title | Text | — | The heading, or nothing for a plain surface. |
| subtitle | Text | — | A second line under the heading. |
| name | Text | — | A name, if the graph will need to reach the card afterwards. |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Begin Column
FunctionOpen a column: everything added until the matching End stacks top to bottom.
BeginColumn
GUI Application: GUI Application
spacing: Number
name: Textvoid BeginColumn(
GUIApplication GUI Application,
double spacing = 10,
string name)Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — | |
| spacing | Number | 10 | Gap between the children, in pixels. |
| name | Text | — | A name, if the graph will need to reach the column afterwards. |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Begin Grid
FunctionOpen a grid of equal cells. Children fill it row by row, in the order they are added, unless one is
placed explicitly with GUIApplication.PlaceInGrid.
BeginGrid
GUI Application: GUI Application
columns: Integer
rows: Integer
spacing: Number
name: Textvoid BeginGrid(
GUIApplication GUI Application,
int columns = 2,
int rows = 0,
double spacing = 8,
string name)Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — | |
| columns | Integer | 2 | How many cells across. |
| rows | Integer | 0 | How many cells down, or 0 for as many as the children need. |
| spacing | Number | 8 | Gap between cells, in pixels. |
| name | Text | — | A name, if the graph will need to reach the grid afterwards. |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Begin Row
FunctionOpen a row: everything added until the matching End runs left to right.
BeginRow
GUI Application: GUI Application
spacing: Number
name: Textvoid BeginRow(
GUIApplication GUI Application,
double spacing = 8,
string name)Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — | |
| spacing | Number | 8 | Gap between the children, in pixels. |
| name | Text | — | A name, if the graph will need to reach the row afterwards. |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Close
FunctionAsk to stop. Whatever is running the application decides what that means - a windowed host closes its
window, an offline driver stops pumping.
Close(GUI Application: GUI Application)
void Close(GUIApplication GUI Application)
Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
End
FunctionClose the innermost open container. Every Begin needs one.
End(GUI Application: GUI Application)
void End(GUIApplication GUI Application)
Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Desired Window Size
FunctionHow big a window to open. A host offers a default before anything runs; the entry callback may say
otherwise, and the host honours whatever the answer is when it opens a window.
DesiredWindowSize(GUI Application: GUI Application) -> Size
Size DesiredWindowSize(GUIApplication GUI Application)
Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — |
Returns
| result | Size |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Desired Window Title
FunctionThe window's title.
DesiredWindowTitle(GUI Application: GUI Application) -> Text
string DesiredWindowTitle(GUIApplication GUI Application)
Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — |
Returns
| result | Text |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Get Elapsed Time
FunctionTime the current frame represents, in milliseconds.
GetElapsedTime(GUI Application: GUI Application) -> Number
double GetElapsedTime(GUIApplication GUI Application)
Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — |
Returns
| result | Number |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Get Text
FunctionWhat a named element says right now - for a text box, what the person has typed.
GetText(GUI Application: GUI Application, name: Text) -> Text
string GetText(GUIApplication GUI Application, string name)
Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — | |
| name | Text | — |
Returns
| result | Text |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Has Element
FunctionWhether the screen has an element of this name.
HasElement -> Truth
GUI Application: GUI Application
name: Textbool HasElement(GUIApplication GUI Application, string name)
Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — | |
| name | Text | — |
Returns
| result | Truth |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Place In Grid
FunctionPut the element added most recently in a particular cell of the grid it is in.
PlaceInGrid
GUI Application: GUI Application
row: Integer
column: Integer
rowSpan: Integer
columnSpan: Integervoid PlaceInGrid(
GUIApplication GUI Application,
int row,
int column,
int rowSpan = 1,
int columnSpan = 1)Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — | |
| row | Integer | — | The row, from 0 at the top. |
| column | Integer | — | The column, from 0 at the left. |
| rowSpan | Integer | 1 | How many rows it covers. |
| columnSpan | Integer | 1 | How many columns it covers. |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Press
FunctionAct on an intent as if a button meaning it had been pressed - what a keyboard shortcut does.
Press(GUI Application: GUI Application, intent: Text)
void Press(GUIApplication GUI Application, string intent)
Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — | |
| intent | Text | — | What to act on. |
Remarks
The reason a keyboard arm does not have to repeat a click arm: a graph reads a key, decides which of
its own keys it stands for, and presses that. The press is indistinguishable from a real one - the
same GUIApplication.Clicked, the same GUIApplication.WasClicked for the rest of the frame - because it
goes through the same door. An intent no button carries is allowed: a key may mean something the
screen has no button for.
Calling this from inside GUIApplication.Clicked with the intent being handled would not return; that
is the ordinary hazard of a callback that calls itself, and the answer is the ordinary one.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Rebuild
FunctionAsk for the screen to be described again: Build runs afresh before the next frame, and the widgets
are made anew from what it says.
Rebuild(GUI Application: GUI Application)
void Rebuild(GUIApplication GUI Application)
Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — |
Remarks
Requested rather than done here, because the host is in the middle of a frame - possibly inside the
very button handler asking for this - and the widgets it is routing input through must not be replaced
under it. Nothing is lost by waiting one frame; a rebuild is for a screen whose SHAPE changes, and
text that merely changes goes through GUIApplication.SetText without one.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Set Enabled
FunctionWhether a named element can be used. A disabled button draws dimmed and delivers nothing.
SetEnabled
GUI Application: GUI Application
name: Text
enabled: Truthvoid SetEnabled(
GUIApplication GUI Application,
string name,
bool enabled = true)Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — | |
| name | Text | — | |
| enabled | Truth | True |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Set Padding
FunctionSet the room inside the edge of the container opened most recently.
SetPadding(GUI Application: GUI Application, padding: Number)
void SetPadding(
GUIApplication GUI Application,
double padding = 14)Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — | |
| padding | Number | 14 | Pixels on every side. |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Set Size
FunctionFix the size of the element added most recently. Leave a dimension NaN to keep it free.
SetSize
GUI Application: GUI Application
width: Number
height: Numbervoid SetSize(
GUIApplication GUI Application,
double width = double.NaN,
double height = double.NaN)Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — | |
| width | Number | NaN | Pixels, or NaN for "as wide as it needs and may". |
| height | Number | NaN | Pixels, or NaN for "as tall as it needs and may". |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Set Stretch
FunctionGive the element added most recently a share of the free room in its column or row.
SetStretch(GUI Application: GUI Application, weight: Number)
void SetStretch(
GUIApplication GUI Application,
double weight = 1)Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — | |
| weight | Number | 1 | Its share, against the shares of its siblings. 1 for an equal share. |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Set Text
FunctionChange what a named element says: a label's text, a button's caption, a text box's content.
SetText
GUI Application: GUI Application
name: Text
text: Textvoid SetText(
GUIApplication GUI Application,
string name,
string text = "")Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — | |
| name | Text | — | |
| text | Text | — |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Set Text Fit
FunctionDraw the text of the element added most recently as large as fits it, growing and shrinking with the room it is given - or, for a container, the text of every label and button inside it.
SetTextFit
GUI Application: GUI Application
fit: Truth
margin: Numbervoid SetTextFit(
GUIApplication GUI Application,
bool fit = true,
double margin = 0.2)Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — | |
| fit | Truth | True | Whether to fit the text; false goes back to the size its role has. |
| margin | Number | 0.2 | How much room to leave round the text, as a share of the box's shorter side on each side: 0.2 leaves a fifth above and below. |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Set Visible
FunctionWhether a named element is shown at all. A hidden element takes no room.
SetVisible
GUI Application: GUI Application
name: Text
visible: Truthvoid SetVisible(
GUIApplication GUI Application,
string name,
bool visible = true)Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — | |
| name | Text | — | |
| visible | Truth | True |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Set Window Size
FunctionSet the size the window opens at.
SetWindowSize
GUI Application: GUI Application
width: Number
height: Numbervoid SetWindowSize(
GUIApplication GUI Application,
double width = 480,
double height = 640)Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — | |
| width | Number | 480 | |
| height | Number | 640 |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Set Window Title
FunctionSet the window's title.
SetWindowTitle(GUI Application: GUI Application, title: Text)
void SetWindowTitle(
GUIApplication GUI Application,
string title = "Divooka")Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — | |
| title | Text | Divooka |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Show Notice
FunctionShow a brief notice in the corner of the window.
ShowNotice(GUI Application: GUI Application, message: Text)
void ShowNotice(GUIApplication GUI Application, string message)
Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — | |
| message | Text | — |
Remarks
Queued rather than shown, because this package has nothing to show it with; the host drains the queue
each frame. A message posted from Start, before there is a window, is shown on the first frame.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Was Clicked
FunctionWhether a button meaning this was pressed during the current frame.
WasClicked -> Truth
GUI Application: GUI Application
intent: Textbool WasClicked(GUIApplication GUI Application, string intent)
Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — | |
| intent | Text | — |
Returns
| result | Truth |
Remarks
The polling half of input, for an Update that would rather ask than be told. False outside a
frame and false for an intent nobody named: an unpressed button is the ordinary case.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Was Key Pressed
FunctionWhether this key was pressed during the current frame.
WasKeyPressed -> Truth
GUI Application: GUI Application
key: Textbool WasKeyPressed(GUIApplication GUI Application, string key)
Parameters
| name | type | default | description |
|---|---|---|---|
| GUI Application | GUI Application | — | |
| key | Text | — | The key, as GUIApplication.KeyPressed describes it. |
Returns
| result | Truth |
Remarks
The polling half of the keyboard, for an Update that would rather ask than be told.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Build
EventDescribe the screen: open containers, add labels and buttons, close containers. Runs once when the
window is ready, and again whenever the graph asks to GUIApplication.Rebuild.
Build()
void Build()
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Clicked
EventA button was pressed.
Clicked(intent: Text)
void Clicked(string intent)
Parameters
| name | type | default | description |
|---|---|---|---|
| intent | Text | — | What the button MEANS - the intent it was added with, which is its caption unless the graph said otherwise. |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Key Pressed
EventA key was pressed.
KeyPressed(key: Text)
void KeyPressed(string key)
Parameters
| name | type | default | description |
|---|---|---|---|
| key | Text | — | The key, as text. A key that types something arrives as what it typed - "7", ".", "+", "A" - and a key that types nothing arrives by name: "Enter", "Escape", "Backspace", "Tab", "Delete", "Left", "Right", "Up", "Down", "Home", "End", "Page Up", "Page Down", "Insert", "F1".."F12". See GUIApplication.NamedKeys. |
Remarks
Text rather than a key enumeration, for two reasons. A graph compares text - that is what its Equals
and Choose nodes are for - and an enumeration would need a palette of its own before a document could
name a key. And what a key TYPES is the layout's answer, not the keycode's: the key beside
0 types . on one keyboard and , on another, and a calculator wants the former.
A key held down repeats as the platform repeats it, because that is what a person typing expects.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Start
EventDivooka procedural program entry, equivalent to "Main" in many programming languages. Runs before the
window exists, which is where window size and title belong; the screen itself is described in
GUIApplication.Build.
Start()
void Start()
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications
Update
EventCalled once per frame, after that frame's presses have been delivered.
Update(deltaTimeMilliseconds: Number)
void Update(double deltaTimeMilliseconds)
Parameters
| name | type | default | description |
|---|---|---|---|
| deltaTimeMilliseconds | Number | — | Time elapsed since the previous frame. |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events StateMachineState
- Declared by
- GUI Application
- Package
- GUI Applications