loom & weft
Made for Swift.

Published release 0.2.1. Unreleased PR #2 reference.

LOOM 0.2.1 / WIDGETS

DesktopIcon

id must be unique in a Desktop. launchTarget is an application-defined string returned on activation; loom does not open a process or window itself.

Standard inherited Swift protocol operations such as synthesized equality and OptionSet set operations are not repeated. The public declarations below are extracted from the exact source revision listed in the coverage manifest.

Example

let icon = DesktopIcon(id: "help", label: "Help", symbol: "?", launchTarget: "help")
_ = Desktop(viewport: Rect(width: 80, height: 24), icons: [icon])
Members on this page

Feature guides and release status

DesktopIcon

Structure
struct DesktopIcon

Conforms to: Swift.Equatable, Swift.Sendable, Swift.SendableMetatype.

A desktop icon and the application-defined target it opens.

IDs must be unique within a desktop. Loom renders the icon and returns its launch target; the application owns the target's content and lifetime.

Source · Desktop.swift:7

id

Instance Property
let id: String

Stable identity for this icon or code block.

Source · Desktop.swift:8

label

Instance Property
let label: String

Visible item label.

Source · Desktop.swift:9

symbol

Instance Property
let symbol: String

The visible grapheme or symbol string.

Source · Desktop.swift:10

launchTarget

Instance Property
let launchTarget: String

Application-defined target returned when an icon is activated.

Source · Desktop.swift:11

init(id:label:symbol:launchTarget:)

Initializer
init(id: String, label: String, symbol: String, launchTarget: String)

Creates a value with the supplied arguments. Default arguments are shown in the declaration.

Parameters (4)
id
Stable entry/icon identity, not an array index.
label
Argument type and any default are shown in the declaration; see the behavior notes above.
symbol
Argument type and any default are shown in the declaration; see the behavior notes above.
launchTarget
Argument type and any default are shown in the declaration; see the behavior notes above.
Source · Desktop.swift:13