gui/docs/framework/window.md
Snider 2f7b85416a
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Add chat vision capability metadata
2026-04-15 21:04:09 +01:00

1.1 KiB

Window Service

The Window service covers named application windows, persisted geometry, and layout-aware placement for Core GUI applications.

Features

  • Named windows with stable lookup keys
  • Size and position persistence between launches
  • Minimum and maximum size constraints
  • Centering and explicit screen placement
  • Layout composition for tiling and snapping

Basic Usage

import "github.com/Snider/Core/pkg/window"

w := window.New(
    window.WithName("main"),
    window.WithTitle("Core GUI"),
    window.WithSize(1200, 800),
    window.WithMinSize(800, 600),
    window.WithCentered(),
)

Layouts

layout.Register("development", window.Layout{
    Windows: []window.WindowArrangement{
        {Name: "editor", Screen: 0, Position: window.Left, Size: window.Half},
        {Name: "preview", Screen: 0, Position: window.Right, Size: window.Half},
    },
})

layout.Apply("development")

Persistence

Window state is restored from the user's Core config directory, so a named window reopens at its previous size and position unless an explicit override is supplied.