-
Notifications
You must be signed in to change notification settings - Fork 0
Dock
Wire names dockrow · dockentry
A row of entries standing for windows that are not on screen — where a minimized MDIPane window goes. Clicking an entry is the gesture that asks for its window back.
d=new dockrow entry_width=20 children={
e=new dockentry caption="Report.txt" window=1042
}
sub d.e click
| Property | Type | Default | Meaning |
|---|---|---|---|
entry_width |
int | — | Width of each dock entry in units |
Plus the common properties.
| Property | Type | Default | Meaning |
|---|---|---|---|
caption |
string | — | Dock entry caption |
window |
int | — | Hosted window id |
dockentry is a virtual type and takes none of the common properties:
new dockrow children={ new dockentry caption="x" bg=blue }
-> property "bg" is not supported by this type
click — A docked entry was clicked — the gesture that restores a minimized window.
| Field | Type | Meaning |
|---|---|---|
trinket |
uint | The entry's object ID. |
window |
uint | The window the entry stands for. |
The event belongs to the entry, not the row, so that is what you
subscribe to — and trinket is the entry's own id:
sub d.e click
A dock of several entries means several subscriptions, one per entry. There is no row-level event that reports a click on whichever entry was hit.
Nothing connects a pane to a dock automatically. Minimizing a window in an
MDIPane raises minimize and does not create an entry; clicking a
dock entry raises click and does not restore anything. The application is
the wire between them.
The round trip is:
-
minimizearrives from the pane, carryingwindowandtitle. - The client adds an entry:
set d children={ new dockentry caption=… window=… }. - The user clicks it, and
clickarrives carrying thatwindow. - The client restores it:
set p restore=<window>, and destroys the entry.
Which means the dock is a general list of standing-for-a-window entries rather than an MDI accessory. Anything an application wants represented that way can go in it.
An entry is a real wire object with an id. A correlation key inside
children={…} does not come back in the build reply, so surface it the usual
way and keep the number:
eid=d.e
destroy removes an entry from the row:
destroy d.e
caption and window are both writable after the entry is docked, and only
one of them takes effect. The caption changes; the window does not — the
entry goes on reporting whatever window it was built with:
click -> trinket=14 window=1042 # built with window=1042
set d.e caption="Renamed" window=2000
click -> trinket=14 window=1042 # still 1042, though the caption is now "Renamed"
Nothing errors, and the two properties give no sign of behaving differently. So an entry that is meant to follow whichever window is currently minimized into it will keep restoring the first one.
Until that is fixed, destroy the entry and add a new one rather than
retargeting it. An entry built with the right window behaves correctly for
its whole life; it is only the later change that is lost.
An entry may name a window that does not exist, or none at all:
new dockrow children={ new dockentry caption="x" }
-> accepted, standing for window 0
The dock holds captions and numbers; it does not look them up. A wrong number surfaces when the click arrives and the application tries to restore something that is not there.
MDIPane — where minimized windows come from · Window · Common Properties
KittyTK — image/tty Trinket Kit · MIT licensed · alpha, 0.1.x
Repository · Issues · Support on ko-fi
Sibling projects: PurfecTerm (terminal emulator) · mew (text editor) · PawScript (language)
Getting Started
Installation Building from Source Running a Display Host Your First Application Examples
Protocol
Protocol Overview Object Model Properties and Values Events Templates and Aliases Common Properties Introspection Transports and Security
Clients
Go Client Python Client C Client
Application Objects
Application · MenuBar · Window · MessageBox
Output Trinkets
Label · ProgressBar · StatusBar
Input Trinkets
TextInput · Editor · Terminal
Button · CheckBox · RadioButton
ListView · ComboBox · TreeView
Layout Trinkets
TabTrinket · Panel
ScrollArea · MDIPane
Separator · Spacer · Splitter
Other Trinkets
Layout Helpers