silk

command module
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 11 Imported by: 0

README

SilkIDE folded silk S logo

Silk — Cross-Platform Go UI Framework & Visual Designer

A Go-native GUI framework with a visual form designer and integrated Go IDE. Drag widgets onto a canvas, arrange nested layouts, generate Go code, then build and run from the same workbench. The project is working toward a Qt Creator-style workflow; it does not claim full feature parity.

The SilkIDE mark is a cyan-to-blue folded silk S. Transparent PNGs and Windows/macOS application icons live in assets/branding.


Table of Contents


Integrated Go Designer / IDE

Actual macOS arm64 window captured on 2026-09-11, using the dark theme and an isolated demo project. This is a running application, not a mockup.

Actual Windows 10 interactive desktop capture from the 2026-10-20 iteration (PDT), limited to the application frame. See Windows rendering and SDK QA for reproducible steps and remaining issues.

Actual Windows menu capture. Latest Windows font / menu QA capture (debug outlines enabled). Windows IME positioning and Unicode input follow-up.

make run-ide     # Qt Creator-style Go editing + visual design workbench
make test-ide    # IDE, designer, widgets and tool-engine regression tests
  • Welcome / Edit / Design modes: Cmd+1/2/3 on macOS, Ctrl+1/2/3 elsewhere.
  • Save and undo/redo always target the visible document, from the toolbar, command palette or keyboard. Cmd/Ctrl+Shift+S saves all changed documents.
  • Real file tabs only: edits show *; undoing back to the saved text clears it.
  • Restart restores tab order, active file, cursor, vertical scroll and mode. Missing files are skipped; older path-only sessions still load. Unsaved code buffers are not crash backups: save/discard/cancel remains the quit guard.
  • Saving .silkui regenerates a companion .silk.go: nested widgets, logical geometry, empty captions, scalar properties and exact RGBA colors are preserved. Declarative output describes structure; wire event handlers with BuildWithIndex in host code, or use the imperative exporter for handler bodies.
  • Live preview: Cmd/Ctrl+Shift+R, or the eye button; export is a separate action.
  • Built-in vector icons require no external directory. They use exact sRGB theme/semantic palettes and rasterize at the device transform for Retina and fractional scaling; disabled icons have their own neutral palette.
  • Build / Run infer the nearest go.mod for forms stored in subdirectories; explicit project and run-directory settings take precedence.
  • Drag-and-drop respects nested container ownership and form bounds. HBox, VBox, Grid and Form layouts share selection/locking rules with the context menu.
  • File / Edit / View / Design / Build / Tools / Help menus group related actions, show shortcuts in a separate column, and support Alt accelerators and arrows. The searchable widget palette retains factory identity and drag/drop behavior. Search fields support selection replacement and clipboard editing, with long queries clipped away from the search/clear icons.
  • Menus support keyboard navigation, disabled actions and nested popup dismissal. Properties and View Code activate the corresponding dock instead of silently doing nothing; export reports the actual output path or an error.
  • Stop terminates the active Run command and its child processes as well as the debugger; independently opened terminal sessions are left alone.
  • Project settings use the selected project root and persist Kit changes. About separates IDE and SDK versions, shows runtime/build details, and wraps or scrolls long content without overlapping its right-aligned Close button.
  • Fit canvas: Cmd/Ctrl+Shift+0 (plain F remains available for code input).

For desktop verification, use a disposable project and an isolated settings home. gopls and dlv are optional external tools; installing or building the IDE alone does not establish language-server or debugger availability.

Validation Status

The 2026-10-20 race/render follow-up bounds UI callback turns, prevents native Windows input/paint/timer starvation during callback bursts, joins outstanding GLFW wakeups before shutdown, and serializes build-progress delivery. The optional pure-Go backend no longer shares mutable glyph buffers across separate canvases, and its dash, exact-color, disabled-icon and high-DPI stroke regressions are covered. Raster/custom icons now select device-resolution sources, Windows offscreen text uses neutral grayscale antialiasing, and the GL blit respects premultiplied alpha instead of darkening translucent edges. These fixes do not add Windows per-monitor DPI awareness. See race and rendering QA for actual commands, evidence and remaining backend limits.

The 2026-10-11 core iteration adds zero-allocation RGBA/NRGBA image uploads, damage-sized GLFW texture transfers, draw-time invalidation retention, and in-place activation of an existing free layout container. Real macOS GL texture readback covers PBO and direct-upload paths. See Rendering QA for measurements, reproduction commands, and platform/UI verification limits. The Windows UI iteration adds owned native Open/Save dialogs, theme-aware object inspection, process-local Go tool discovery, and deterministic retirement of native paint resources. It also removes translation-only scaled-font cache keys. Integer properties now use an exact, registered editor; generated companions follow the neighboring Go package. Background Windows tool commands no longer open an intrusive console window. The 2026-10-20 native audit fixes EndPaint accidentally calling BeginPaint, owned window-icon retirement, and two additional misrouted SDK API wrappers. The reproduced repeated-menu GDI growth now plateaus in the bounded native run. The editor also supports document-boundary Ctrl/Cmd+Home/End navigation and Shift selection, including Unicode, folded EOF and viewport following. The input follow-up anchors Windows IME composition/candidates to the focused editor, handles UTF-16 surrogate pairs and WM_UNICHAR, and verifies actual Pinyin commit/cancel plus supplementary Unicode save/readback. The text follow-up adds coverage-checked Windows CJK/emoji font runs with matching drawing/caret metrics, while retaining ASCII monospace rendering. Native file chooser waits no longer produce false UI-stall dumps. This is not full IME or complex-script shaping certification; see Windows text QA.

Environment Latest local evidence Not established by this check
macOS arm64 / Go 1.26.5 2026-10-20 18-package race regression (4,885 pass / 9 skip), pure-Go rendering and strict real GL readback; later GUI/task-runner deltas retested; earlier desktop QA remains dated evidence New seven-group menu desktop QA on macOS, every secondary panel action, real gopls/dlv workflows, mixed-DPI multi-monitor behavior
Linux arm64 / Go 1.26.0 Earlier Debian 12 build, four-package tests, vet and non-root Xvfb window-startup smoke; not rerun this iteration Interactive desktop/IME/font coverage; a portable dependency-free binary
Windows 10 22H2 amd64 / Go 1.26.5 / Cairo 1.18.4 Thirteen-package native and race regression (4,638 pass / 39 skip), pure-Go rendering, race/normal GUI input/save/resize and background-output checks; later native task-tree cancellation regressions; earlier bounded GDI plateau, paint pairing, accelerator dispatch, icon lifetime, layout persistence/resize and F6 build; real Pinyin commit/cancel, Unicode save/readback, visible CJK/emoji/Ext-B glyphs, caret geometry and scaled pixel comparisons Startup/input-latency certification, complex shaping and raw-glyph rich text fallback, full IME, mixed-DPI/multi-monitor, all widget/menu combinations, real gopls/dlv, physical printing and unbounded resource stability

Run/Build currently use saved files on disk; save edits before running. IDE symbol actions require gopls and report when it is unavailable. Some panels still have incomplete localization/font fallback. Passing tests or installing external tools alone is not a full desktop compatibility claim. The earlier silk_pure_go dash, icon color/path and allocation failures are fixed and its 192-case rendering run passes on macOS and Windows. This does not certify complete native Cairo parity, complex shaping or every desktop path.

Detailed, dated verification records: workbench · menus and About · SDK/platform compatibility · popup ownership · designer gaps · Windows desktop iteration · Windows rendering/SDK verification · Windows input follow-up. Local bin/qa-artifacts/ evidence mentioned in those records is not shipped in Git.

Rendering performance

Static UI no longer requests frames just to maintain a refresh rate. Ongoing quiet animation is capped at 25 FPS; input briefly raises the ceiling to 60 FPS, with extra recovery time after expensive frames. Windows rendering uses a coalesced deadline timer rather than a paint-to-animation feedback loop; custom modal dialogs block waiting for messages instead of polling every 1 ms. Hidden busy widgets stop their animation. Text/modified-state/outline caches avoid repeated full-document work while idle. These are code-level fixes; Windows native idle/resource samples are recorded in Windows UI QA; a full before/after CPU reduction or input-latency improvement is not established.

Windows previously requested macOS's Menlo font and resolved a proportional fallback, disabling the editor's ASCII measurement fast path. Platform defaults are now Consolas / Menlo / monospace. On the Windows QA machine, the isolated 48-character measurement benchmark drops from 4.96–5.55 µs and 2 allocations to 77–97 ns and zero allocations. This is one hot path, not whole-IDE FPS; non-ASCII text and non-monospaced overrides retain native shaping.

See bounded CPU capture and Windows verification. Profiling is opt-in, local-only, and stops automatically after 30 seconds.

Quick Start

# 1. Clone
git clone https://github.com/uk0/silk.git
cd silk

# 2. Install system dependencies (macOS)
brew install cairo pkg-config

# 3. Build and run the integrated Go designer / IDE
make run-ide

# 4. Or run the widget gallery demo
CGO_CFLAGS="-I/opt/homebrew/include" go run demo.go

Drag widgets from the left panel onto the canvas, press F5 to compile & run.


Development Setup

Prerequisites
Dependency Minimum Version Purpose
Go 1.26+ Compiler
CGO enabled Required for Cairo
Cairo 1.16+ 2D rendering backend
pkg-config any Find Cairo headers
GLFW 3.3 auto-downloaded Window management (macOS/Linux)
macOS
# Install Homebrew (if not installed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install Cairo and pkg-config
brew install cairo pkg-config

# Verify
pkg-config --cflags --libs cairo
# Should output: -I/opt/homebrew/Cellar/cairo/.../include -L/opt/homebrew/Cellar/cairo/.../lib -lcairo

If go build can't find cairo/cairo.h, export the include path:

export C_INCLUDE_PATH=/opt/homebrew/include
export CGO_CFLAGS="-I/opt/homebrew/include"
export CGO_LDFLAGS="-L/opt/homebrew/lib -lcairo"

Add these to your ~/.zshrc or ~/.bashrc for persistent use.

Windows

silk's Cairo bindings need gcc + pkg-config + cairo from MSYS2's UCRT64 toolchain. Once those are on PATH, go build / go run / go test work from any of the three common Windows shells. Pick the one you prefer; the build flow is identical, only the env-var syntax differs.

One-time setup
  1. Install MSYS2 from https://www.msys2.org/.
  2. Open the MSYS2 UCRT64 shell (Start → "MSYS2 UCRT64").
  3. Install the toolchain:
    pacman -S mingw-w64-ucrt-x86_64-gcc \
              mingw-w64-ucrt-x86_64-pkgconf \
              mingw-w64-ucrt-x86_64-cairo
    
Build & run from each shell

MSYS2 UCRT64 (recommended — PATH is already set):

cd /c/path/to/silk
go build -o silkide.exe ./cmd/silkide/
./silkide.exe
go test ./gui/ ./ged/ ./paint/ ./graph/ ./geom/

PowerShell:

$env:PATH = "C:\msys64\ucrt64\bin;$env:PATH"
cd C:\path\to\silk
go build -o silkide.exe .\cmd\silkide\
.\silkide.exe
go test .\gui\ .\ged\ .\paint\ .\graph\ .\geom\

Command Prompt (cmd.exe):

set PATH=C:\msys64\ucrt64\bin;%PATH%
cd C:\path\to\silk
go build -o silkide.exe .\cmd\silkide\
silkide.exe
go test .\gui\ .\ged\ .\paint\ .\graph\ .\geom\
Verify
go env CGO_ENABLED   # 1
gcc --version        # ucrt64 gcc, 13.x or newer
pkg-config --modversion cairo  # 1.18.x

If go build errors with 'cairo.h' file not found, the UCRT64 bin/ isn't on PATH — re-run the env-var line for your shell. The win32 package is compile-tagged Windows-only so it only enters the build on this platform; on macOS/Linux it's a no-op.

Linux (Ubuntu/Debian)
sudo apt update
sudo apt install -y \
    build-essential \
    pkg-config \
    libcairo2-dev \
    libx11-dev \
    libxcursor-dev \
    libxi-dev \
    libxinerama-dev \
    libxrandr-dev \
    libxxf86vm-dev \
    libgl1-mesa-dev

# Verify
pkg-config --libs cairo
Linux (Fedora/RHEL)
sudo dnf install -y \
    gcc pkgconfig \
    cairo-devel \
    libX11-devel libXcursor-devel libXi-devel \
    libXinerama-devel libXrandr-devel libXxf86vm-devel \
    mesa-libGL-devel

Project Structure

silk/
├── core/             Foundation layer
│   ├── factory.go        Object creation from registered types
│   ├── signal-slot.go    Event binding mechanism
│   ├── tdoc.go           Tree-structured persistence
│   └── shell.go          Platform file paths
│
├── gui/              Widgets + theming + layout engine
│   ├── widget.go         Base widget class
│   ├── button.go, label.go, edit.go, ...
│   ├── hbox.go, vbox.go, gridlayout.go   Layout containers
│   ├── theme.go          Color schemes
│   ├── animation.go      12 easing functions
│   ├── codeeditor.go     Full-featured code editor (~3,300 lines)
│   ├── formloader.go     SDK-level .silkui loader
│   ├── window_glfw.go    macOS/Linux window backend
│   └── window_windows.go Windows window backend
│
├── graph/            Scene graph for design canvas
│   ├── view.go           Graph view with zoom/pan
│   ├── tool.go           Interaction tools
│   └── resize-decor.go   Resize handles
│
├── ged/              Visual designer (GUI Editor)
│   ├── ged-view.go       Design canvas
│   ├── codegen.go        Go code generation
│   ├── code-panel.go     Event handler editor
│   ├── file-explorer.go  Project file tree
│   ├── editor-tabs.go    Multi-tab editor
│   ├── build-output.go   Compile error navigation
│   └── ... (25+ designer panels)
│
├── paint/            Cairo rendering abstraction
├── cairo/            Cairo C bindings (CGO)
├── geom/             2D vectors, matrices, rectangles
├── prop/             Property system
│
├── examples/         Runnable examples
│   ├── calculator/       Calculator app
│   ├── dashboard/        Charts & data binding
│   ├── todoapp/          Todo list
│   ├── texteditor/       Basic text editor
│   ├── showcase/         Widget gallery demo
│   └── load_silkui/      SDK loader example
│
├── icon/             PNG icons (4 sizes × 64 icons)
│
├── design.go         Visual designer entry point
├── demo.go           Widget gallery demo
└── sandbox.go        Test sandbox
Module Layout
// go.mod
module github.com/uk0/silk

Internal imports use: github.com/uk0/silk/core, github.com/uk0/silk/gui, github.com/uk0/silk/ged, etc.


组态 / SCADA & Industrial Platform

Beyond the widget toolkit, Silk ships a full industrial-automation (组态) stack built on a real-time tag database:

  • Field-bus drivers — Modbus TCP, Siemens S7, OPC-UA and MQTT, covering every PLC data type and all four register/byte orders (ABCD/DCBA/BADC/CDAB), read-only or read-write. Wrap two in a redundant driver for primary/backup failover, or bridge protocols with the gateway. A simulator driver runs screens without hardware.
  • Tags & bindings — core.TagDB streams device values into widgets via value-driven bindings, animation, alarms and rolling trends. Configure a device and its tag points visually with DeviceComponent, or stamp many devices from a structured template.
  • Data & logic — historian (SQLite history), reports (interval aggregation → CSV/HTML), trend playback, recipes, calc/formula tags, event log, live statistics, runtime Go scripting, and user auth with login sessions.
tags := core.NewTagDB()
dev := device.NewDeviceComponent()          // Modbus / S7 / OPC-UA / MQTT
dev.SetProtocol("modbus")
dev.SetHost("192.168.0.10")
dev.SetPoints("level, hr:0, Float32, ABCD, RO\npump, coil:0, Bool, ABCD, RW")
dev.Start(tags)                             // poll device -> tags -> screen

The silkide designer/IDE adds LSP (gopls) code intelligence, a Delve debugger, and Qt Creator-style locator, find-in-files, snippets and build-issue navigation.


Your First App

Option 1: Pure SDK (No Designer)
package main

import (
    "github.com/uk0/silk/core"
    "github.com/uk0/silk/gui"
)

func main() {
    // Create main frame
    f := gui.NewFrameWindow()
    f.SetTitle("My First Silk App")
    gui.SetDefaultFrame(f)

    // Create a form with widgets
    form := gui.NewForm()
    form.SetTitle("Hello")

    btn := gui.NewButton1("Click Me", nil)
    btn.SetParent(form)
    btn.SetBounds(20, 20, 100, 30)
    btn.Action().BindFunc0(func() {
        gui.ShowMessageDialog(f, "Hi", "Hello, World!")
    })

    // Attach and show
    f.SuggestDocDock().AddView(form)
    f.SetClosedCallback(func(*gui.Frame) { core.Quit() })
    if w := f.Window(); w != nil {
        w.SetSize(400, 300)
        w.MoveToCenter()
    }
    f.Show()
    core.EventLoop()
}

Save as hello.go and run:

CGO_CFLAGS="-I/opt/homebrew/include" go run hello.go
Option 2: Load from Designer File

Design your form visually in the designer, save as main.silkui, then:

package main

import (
    "github.com/uk0/silk/core"
    "github.com/uk0/silk/gui"
    "log"
)

func main() {
    // Load design file — produced by the visual designer
    form, err := gui.LoadForm("main.silkui")
    if err != nil {
        log.Fatal(err)
    }

    f := gui.NewFrameWindow()
    gui.SetDefaultFrame(f)
    f.SuggestDocDock().AddView(form)
    f.SetClosedCallback(func(*gui.Frame) { core.Quit() })
    f.Show()
    core.EventLoop()
}

No designer code needed at runtime — just github.com/uk0/silk/core + github.com/uk0/silk/gui.


Using the Designer

Launch
CGO_CFLAGS="-I/opt/homebrew/include" go run design.go
Two Modes
Mode Shortcut Purpose
Design Mode Ctrl+1 Drag widgets, edit properties, visual layout
Code Mode Ctrl+2 File explorer, multi-tab code editor
Design Workflow
  1. Drag a widget from the left palette onto the canvas
  2. Click the widget to see/edit properties on the right
  3. Double-click to open the event handler code editor
  4. Press F5 to compile and run your app
  5. Press Ctrl+R for quick preview (no compile)
Code Workflow
  1. Ctrl+2 to enter Code Mode
  2. Ctrl+P to quick-open any file
  3. Cmd/Ctrl+Click on a function → go to definition
  4. Ctrl+Shift+O → symbol navigation
  5. Ctrl+Shift+F → format code (gofmt)
  6. F5 → compile, errors shown with clickable navigation
Full Shortcut Reference

See Help → Keyboard Shortcuts in the designer for all 40+ shortcuts.


Building & Running

Running Examples
# Set CGO flags once per shell session
export CGO_CFLAGS="-I/opt/homebrew/include"
export CGO_LDFLAGS="-L/opt/homebrew/lib -lcairo"

# Then run any example
go run examples/calculator/main.go
go run examples/dashboard/main.go
go run examples/showcase/main.go

Note: Most examples use //go:build ignore — they're standalone programs, not part of the package build.

Building a Release Binary
go build -v -o myapp hello.go

# Smaller binary (strip debug info)
go build -ldflags="-s -w" -o myapp hello.go

# Cross-compile (static linking may require extra setup)
GOOS=linux GOARCH=amd64 go build -o myapp hello.go
Running Tests
# All tests
go test -short ./...

# Specific package with verbose output
go test -v ./gui/

# Benchmarks
go test -bench=. -benchmem ./gui/

Current test suite: 398+ tests, 100% pass rate.

Development Cycle
# 1. Edit source files
vim gui/button.go

# 2. Build to check
go build ./gui/

# 3. Run relevant tests
go test ./gui/

# 4. Launch designer to verify visually
go run design.go

Features

Built-in Widget Families
  • Input (15): Button, Edit, CheckBox, RadioButton, ComboBox, SpinBox, Slider, ToggleSwitch, SearchBox, NumberInput, DatePicker, ColorPicker, Rating, DropdownButton, SwitchGroup
  • Display (12): Label, ProgressBar, GroupBox, ImageView, Tag, Badge, Avatar, Breadcrumb, Link, LabelSeparator, Placeholder, Timeline
  • Layout (10): VBox, HBox, GridLayout, FormLayout, Splitter, StackedWidget, TabWidget, Card, Accordion, ScrollArea
  • Data (4): ListWidget, TreeView, Table, NotificationPanel
  • Charts (5): LineChart, BarChart, PieChart, Gauge, ScatterPlot
  • Window (6): Form, Dialog, Menu, ToolBar, StatusBar, CodeEditor
Designer Features
  • Smart alignment guides (blue snap lines)
  • Ctrl+Scroll zoom, Space+drag pan
  • Object inspector, property editor with categories
  • Undo/redo with visual history panel
  • Code generation for 23+ event types
  • Tab order editor, widget locking
  • Form size presets (Desktop/Tablet/Phone)
  • Theme preview, custom template saving
Code Editor Features
  • Multi-cursor editing (Cmd+Alt+Up/Down)
  • Cmd/Ctrl+Click cross-file go-to-definition
  • Auto-completion (keywords, types, gui.* API)
  • Find/Replace (Ctrl+F), Go to line (Ctrl+G)
  • Symbol navigation (Ctrl+Shift+O)
  • 14 Go code snippets, bracket matching
  • Minimap, bookmarks (Ctrl+B)
  • Rename refactoring (F2 in Silk IDE; requires gopls)
  • Code formatting via gofmt (Ctrl+Shift+F)
  • Error markers with squiggly underlines
  • Split editor view (Ctrl+\)
  • Git gutter markers
IDE Features (silkide)
  • Language server (gopls) — completion, hover, go-to-definition, find-references, rename, format, code actions, signature help, diagnostics, plus call hierarchy, type hierarchy, implementations, inlay hints, semantic tokens and code lens
  • Debugger (Delve) — breakpoints with conditions/hit counts/logpoints, goroutine- and frame-scoped locals, arguments and watches, lazily expanded variables, and a debug console
  • Build & run — kits (toolchain, GOOS/GOARCH, tags, race/coverage, deploy profile), multiple named run/debug configurations, and a cancellable task runner with streaming output
  • Testing — go test -json driven results in a package → test → subtest explorer with run/debug/rerun-failed and gutter actions
  • Analyzers — vet, race, coverage, pprof, trace, govulncheck, staticcheck
  • Version control — branches, remotes, fetch/pull/push, stash, rebase, cherry-pick, staged/unstaged/conflict grouping, hunk-level diff staging and a three-way merge editor
  • Navigation & search — fuzzy quick-open, project-wide find/replace with regex and transactional preview, grouped references, outline, bookmarks and a live TODO index
  • Terminal — PTY-backed shell session with a full ANSI screen (Unix; ConPTY pending on Windows)

Troubleshooting

cairo/cairo.h not found

Set the include path:

# macOS
export CGO_CFLAGS="-I/opt/homebrew/include"
export CGO_LDFLAGS="-L/opt/homebrew/lib -lcairo"

# Linux
export CGO_CFLAGS="-I/usr/include/cairo"
Icons show as red X

The designer loads icons from the ./icon/ directory. Run from the project root:

cd /path/to/silk
go run design.go   # from the directory containing icon/
"Duplicate libraries -lcairo" warning

Safe to ignore — it's a linker hint, not an error.

Windows: "The application was unable to start correctly (0xc000007b)"

Ensure you're using the MSYS2 UCRT64 shell or have C:\msys64\ucrt64\bin in PATH so Cairo DLLs are found at runtime.

F5 compile fails with "gofmt not found"

Install Go's standard tools (usually included with Go, but verify):

which gofmt
# Should print the gofmt path

Cross-Platform Support

Platform Window Backend Rendering Status
macOS GLFW + OpenGL Cairo ✅ Primary
Windows Win32 native Cairo ✅ Supported
Linux GLFW + OpenGL Cairo ✅ Supported

Tech Stack

  • Go 1.21+ — compiler
  • Cairo 2D — 2D rendering
  • GLFW 3.3 — macOS/Linux window management
  • Win32 API — Windows window management
  • OpenGL 2.1 — texture upload for back-buffer composition
  • Zero external Go GUI dependencies — everything built from scratch

Contributing

# 1. Fork on GitHub
# 2. Clone your fork
git clone https://github.com/YOUR_USERNAME/silk.git
cd silk

# 3. Create a branch
git checkout -b feature/my-feature

# 4. Make changes and test
go test -short ./...

# 5. Commit (no signatures in messages)
git commit -m "Add feature X"

# 6. Push and open a Pull Request
git push origin feature/my-feature

File Format

Design files use the .silkui extension (TDoc-based tree format). Legacy .cml, .silk, .form files are still accepted on load for backwards compatibility.

Gantt chart regression commands, a reproducible .silkui fixture and desktop verification steps are documented in GANTT-TESTING.md.


License

AGPL-3.0


Silk — making Go desktop development silky smooth.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package a11y is Silk's accessibility surface — the equivalent of Qt's QAccessible.
Package a11y is Silk's accessibility surface — the equivalent of Qt's QAccessible.
assets
branding
Package branding embeds Silk IDE's application identity.
Package branding embeds Silk IDE's application identity.
Package auth provides in-memory user credentials and role-based action permissions, modeled on FameView (杰控) 用户权限: operators, engineers and admins with gated actions.
Package auth provides in-memory user credentials and role-based action permissions, modeled on FameView (杰控) 用户权限: operators, engineers and admins with gated actions.
Package bench holds shared painter scenarios that drive both Cairo and glui paint.Painter implementations.
Package bench holds shared painter scenarios that drive both Cairo and glui paint.Painter implementations.
Package buildissues parses the textual output of the Go toolchain (go build, go vet, go test) into structured issues suitable for an Issues pane.
Package buildissues parses the textual output of the Go toolchain (go build, go vet, go test) into structured issues suitable for an Issues pane.
Package calc implements 公式/计算变量 (calc / formula tags): a derived tag whose live value is an expression evaluated over other tags.
Package calc implements 公式/计算变量 (calc / formula tags): a derived tag whose live value is an expression evaluated over other tags.
cmd
silkgen command
silkgen converts a designer-produced .silkui file into a Go source snippet using silk/decl's builder DSL.
silkgen converts a designer-produced .silkui file into a Go source snippet using silk/decl's builder DSL.
silkide command
silkide integrates Go editing, visual UI design, builds and debugging.
silkide integrates Go editing, visual UI design, builds and debugging.
Package core provides foundational utilities for the Silk UI framework.
Package core provides foundational utilities for the Silk UI framework.
Package decl is the declarative authoring layer for Silk widget trees.
Package decl is the declarative authoring layer for Silk widget trees.
Package device is the designer-facing bridge between silk's UI and the field-device layer (package driver).
Package device is the designer-facing bridge between silk's UI and the field-device layer (package driver).
Package driver connects silk's real-time tag database to industrial field devices over Modbus TCP and Siemens S7.
Package driver connects silk's real-time tag database to industrial field devices over Modbus TCP and Siemens S7.
Package eventlog records alarms, user actions and system events into a SQLite table and answers time-range queries, backing FameView's 事件记录 (event/audit log) screen with a persisted, filterable history.
Package eventlog records alarms, user actions and system events into a SQLite table and answers time-range queries, backing FameView's 事件记录 (event/audit log) screen with a persisted, filterable history.
examples
calculator command
charts command
Silk Chart Widget Gallery
Silk Chart Widget Gallery
dashboard command
Silk System Monitor Dashboard
Silk System Monitor Dashboard
databinding command
Silk Data Binding Demo
Silk Data Binding Demo
hmi command
Silk 组态 / HMI — end-to-end example on the scada.Services runtime.
Silk 组态 / HMI — end-to-end example on the scada.Services runtime.
quickstart command
Silk Quick Start — Build your first GUI app in 5 minutes
Silk Quick Start — Build your first GUI app in 5 minutes
scada command
Silk SCADA / 组态 HMI — end-to-end tag-driven water-tank demo.
Silk SCADA / 组态 HMI — end-to-end tag-driven water-tank demo.
texteditor command
Silk Text Editor
Silk Text Editor
todoapp command
Package filesearch is Silk's find-in-files engine — the UI-agnostic core behind an IDE's "Find in Files" (Qt Creator's Search > Find in Files).
Package filesearch is Silk's find-in-files engine — the UI-agnostic core behind an IDE's "Find in Files" (Qt Creator's Search > Find in Files).
Package fswatch is Silk's filesystem-watcher runtime — the equivalent of Qt's QFileSystemWatcher.
Package fswatch is Silk's filesystem-watcher runtime — the equivalent of Qt's QFileSystemWatcher.
Package gateway bridges two field devices: it polls a source device into a shared core.TagDB and forwards every tag change on to a sink device, turning silk into a protocol gateway (数据转发 / FameView 数据转发).
Package gateway bridges two field devices: it polls a source device into a shared core.TagDB and forwards every tag change on to a sink device, turning silk into a protocol gateway (数据转发 / FameView 数据转发).
Package ged implements the visual GUI editor (Silk Designer).
Package ged implements the visual GUI editor (Silk Designer).
Package geom provides 2D geometry primitives.
Package geom provides 2D geometry primitives.
Package graph provides a scene-graph editing framework.
Package graph provides a scene-graph editing framework.
Package gui provides a cross-platform GUI widget toolkit for Go.
Package gui provides a cross-platform GUI widget toolkit for Go.
可以指定比较函数的HashMap.
可以指定比较函数的HashMap.
Package historian turns silk's live-only tag trends into reviewable history: it records core.Tag changes into a SQLite table and answers time-range queries, so a screen that only shows the current value can be backed by a scrollable, persisted trend.
Package historian turns silk's live-only tag trends into reviewable history: it records core.Tag changes into a SQLite table and answers time-range queries, so a screen that only shows the current value can be backed by a scrollable, persisted trend.
Package hotreload bridges silk/fswatch with silk/decl so designer- authored .silkui files can be edited at runtime and trigger an in-process widget tree rebuild without restarting the host process.
Package hotreload bridges silk/fswatch with silk/decl so designer- authored .silkui files can be edited at runtime and trigger an in-process widget tree rebuild without restarting the host process.
Package i18n is Silk's translation runtime — the equivalent of Qt's QTranslator + tr() pair.
Package i18n is Silk's translation runtime — the equivalent of Qt's QTranslator + tr() pair.
ide
bookmarks
Package bookmarks is the persistent store behind an IDE's code bookmarks: (file, line) marks with a note, written to one JSON file and re-anchored to the text of their line so a mark survives edits made above it — including edits made while the IDE was closed.
Package bookmarks is the persistent store behind an IDE's code bookmarks: (file, line) marks with a note, written to one JSON file and re-anchored to the text of their line so a mark survives edits made above it — including edits made while the IDE was closed.
document
Package document is Silk's shared text-document model: the single copy of a file's text that every view of that file agrees on, plus the revision counter, change notifications and stable positions an IDE needs on top of it.
Package document is Silk's shared text-document model: the single copy of a file's text that every view of that file agrees on, plus the revision counter, change notifications and stable positions an IDE needs on top of it.
gotest
Package gotest runs `go test -json` and folds its event stream into the aggregated model in core (core.Aggregator / core.PackageResult).
Package gotest runs `go test -json` and folds its event stream into the aggregated model in core (core.Aggregator / core.PackageResult).
kits
Package kits 存放"某个工程用哪些Kit构建"的持久化状态: Kit列表, 叠在Kit上的构建变体(Debug/Release), 以及当前激活的那一组.
Package kits 存放"某个工程用哪些Kit构建"的持久化状态: Kit列表, 叠在Kit上的构建变体(Debug/Release), 以及当前激活的那一组.
lspedit
Package lspedit turns language-server edit descriptions into text and filesystem changes that either fully apply or not at all.
Package lspedit turns language-server edit descriptions into text and filesystem changes that either fully apply or not at all.
runconfig
Package runconfig models named run/debug configurations for a project — the equivalent of Qt Creator's "Run Settings", where one project owns several launch targets (run the app, debug it, run the package tests) and one of them is the active default.
Package runconfig models named run/debug configurations for a project — the equivalent of Qt Creator's "Run Settings", where one project owns several launch targets (run the app, debug it, run the package tests) and one of them is the active default.
taskrunner
Package taskrunner executes an IDE's build / run / test commands as child processes: a dependency graph of Tasks run in topological order (independent tasks in parallel), every output line streamed as an Event, per-task and whole-run cancellation that kills the entire process group, and a History of what finished, how long it took and how it ended.
Package taskrunner executes an IDE's build / run / test commands as child processes: a dependency graph of Tasks run in topological order (independent tasks in parallel), every output line streamed as an Event, per-task and whole-run cancellation that kills the entire process group, and a History of what finished, how long it took and how it ended.
workspace
Package workspace models an IDE session: the versioned, on-disk record of what a window had open — the project, the editor tabs (with their cursor, scroll position and folded regions), the split/pane layout, dock visibility, and the text of buffers that were never written to disk.
Package workspace models an IDE session: the versioned, on-disk record of what a window had open — the project, the editor tabs (with their cursor, scroll position and folded regions), the split/pane layout, dock visibility, and the text of buffers that were never written to disk.
internal
silkgen
Package silkgen shares source generation between the IDE and command-line generator.
Package silkgen shares source generation between the IDE and command-line generator.
Package locator implements the scoring and filtering engine behind a Qt-Creator-style Locator (Ctrl+K) / fuzzy quick-open box.
Package locator implements the scoring and filtering engine behind a Qt-Creator-style Locator (Ctrl+K) / fuzzy quick-open box.
Package login layers login sessions over the auth package: a Manager authenticates credentials, mints a random token per login, and expires sessions after an idle timeout.
Package login layers login sessions over the auth package: a Manager authenticates credentials, mints a random token per login, and expires sessions after an idle timeout.
Package notify sends native OS desktop notifications, giving the desktop build parity with other native apps: events such as alarms surface through the host notification centre instead of only inside the app window.
Package notify sends native OS desktop notifications, giving the desktop build parity with other native apps: events such as alarms surface through the host notification centre instead of only inside the app window.
Package paint provides 2D drawing primitives built on Cairo.
Package paint provides 2D drawing primitives built on Cairo.
Package pdfexport implements a paint.Painter that records draw operations and serialises them as a PDF 1.4 document.
Package pdfexport implements a paint.Painter that records draw operations and serialises them as a PDF 1.4 document.
Package playback replays recorded historian history into a LineChart: it loads a tag's samples over a time range, optionally decimates them to a point budget, and feeds them into a rolling series so the chart's time axis shows the persisted trend instead of only the live tail.
Package playback replays recorded historian history into a LineChart: it loads a tag's samples over a time range, optionally decimates them to a point budget, and feeds them into a rolling series so the chart's time axis shows the persisted trend instead of only the live tail.
Package printing enumerates installed printers and submits PDF documents.
Package printing enumerates installed printers and submits PDF documents.
Package prop provides a reflection-based property editing system.
Package prop provides a reflection-based property editing system.
Package purecairo is a pure-Go implementation of the Cairo 2D graphics API silk uses, with zero CGO dependencies.
Package purecairo is a pure-Go implementation of the Cairo 2D graphics API silk uses, with zero CGO dependencies.
Package recipe implements FameView-style 配方 (recipe) management: named sets of tag values that can be saved to disk, loaded back, applied (downloaded) to the process, and captured from live tags.
Package recipe implements FameView-style 配方 (recipe) management: named sets of tag values that can be saved to disk, loaded back, applied (downloaded) to the process, and captured from live tags.
Package recpaint implements a paint.Painter that records every operation into an in-memory log and can replay the log onto any other paint.Painter target.
Package recpaint implements a paint.Painter that records every operation into an in-memory log and can replay the log onto any other paint.Painter target.
Package report turns silk's persisted tag history into FameView-style 报表 (interval reports): it slices a time range into fixed buckets, reduces each tag's samples in every bucket with a chosen aggregate, and renders the grid as CSV or HTML.
Package report turns silk's persisted tag history into FameView-style 报表 (interval reports): it slices a time range into fixed buckets, reduces each tag's samples in every bucket with a chosen aggregate, and renders the grid as CSV or HTML.
Package scada is the headless runtime service container for a SCADA / 组态 (HMI) application: it owns ONE of each backend resource — the real-time tag registry, the alarm engine, the historian, the event log, the recipe book and the live-statistics collector — and wires them together so a screen built from the backend-free gui panels has a single, consistent runtime to talk to.
Package scada is the headless runtime service container for a SCADA / 组态 (HMI) application: it owns ONE of each backend resource — the real-time tag registry, the alarm engine, the historian, the event log, the recipe book and the live-statistics collector — and wires them together so a screen built from the backend-free gui panels has a single, consistent runtime to talk to.
Package script runs Go scripts inside silk at runtime (via a yaegi interpreter) with the tag API pre-bound, so designer-authored logic — derived tags, alarm actions, button handlers — can be edited and run without recompiling the app.
Package script runs Go scripts inside silk at runtime (via a yaegi interpreter) with the tag API pre-bound, so designer-authored logic — derived tags, alarm actions, button handlers — can be edited and run without recompiling the app.
Package settings is Silk's preferences-storage runtime — the equivalent of Qt's QSettings.
Package settings is Silk's preferences-storage runtime — the equivalent of Qt's QSettings.
Package sim provides a synthetic driver.Driver that generates values from simple time-based waveforms, so silk HMIs can run, be demoed and be tested without any real PLC or field device attached (the "仿真" / simulation mode familiar from FameView and other SCADA tools).
Package sim provides a synthetic driver.Driver that generates values from simple time-based waveforms, so silk HMIs can run, be demoed and be tested without any real PLC or field device attached (the "仿真" / simulation mode familiar from FameView and other SCADA tools).
Package snippet implements Qt Creator / TextMate / LSP style snippet expansion.
Package snippet implements Qt Creator / TextMate / LSP style snippet expansion.
Package state is Silk's hierarchical finite state machine — the equivalent of Qt's QStateMachine framework.
Package state is Silk's hierarchical finite state machine — the equivalent of Qt's QStateMachine framework.
Package stats computes live per-tag rolling statistics (min/max/avg/count) over a core.TagDB stream — running KPIs for FameView 统计 dashboards.
Package stats computes live per-tag rolling statistics (min/max/avg/count) over a core.TagDB stream — running KPIs for FameView 统计 dashboards.
Package svg is Silk's SVG rendering layer — the equivalent of Qt's QSvgRenderer.
Package svg is Silk's SVG rendering layer — the equivalent of Qt's QSvgRenderer.
Package svgexport implements a paint.Painter that records draw operations and serialises them as SVG XML.
Package svgexport implements a paint.Painter that records draw operations and serialises them as SVG XML.
Package systray is a thin wrapper over fyne.io/systray that places the application in the OS system tray with clickable menu items, giving the desktop build parity with native apps (for example, surfacing alarms from a tray menu).
Package systray is a thin wrapper over fyne.io/systray that places the application in the OS system tray with clickable menu items, giving the desktop build parity with native apps (for example, surfacing alarms from a tray menu).
Package template provides 结构化组态 device templates: define a device type once — its tags, their address offsets, data types, byte orders and access modes — then stamp it across many instances in one batch.
Package template provides 结构化组态 device templates: define a device type once — its tags, their address offsets, data types, byte orders and access modes — then stamp it across many instances in one batch.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL