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
struct DesktopIconConforms 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:7id
let id: StringStable identity for this icon or code block.
Source · Desktop.swift:8label
let label: StringVisible item label.
Source · Desktop.swift:9symbol
let symbol: StringThe visible grapheme or symbol string.
Source · Desktop.swift:10launchTarget
let launchTarget: StringApplication-defined target returned when an icon is activated.
Source · Desktop.swift:11init(id:label:symbol:launchTarget:)
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.