window

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 32 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package window is the desktop app's window (plan 0009): it joins the session, the workspace, the panes and the notes' views under frostui's chrome. It is the only desktop package that knows all of them.

Index

Constants

View Source
const BackgroundPoll = 2 * time.Second

BackgroundPoll is how often the open dialog reads the desktop's answer again (ADR-0033).

View Source
const RefreshDelay = 300 * time.Millisecond

RefreshDelay is how long after a change in the vault the panes read again.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Session *session.Session
	Prefs   prefs.Prefs
	State   prefs.State
	Store   *workspace.Store

	Catalog *catalog.Catalog

	Shell   frostui.PaneShell
	Dialogs frostui.Dialogs
	// contains filtered or unexported fields
}

App is the window's state. UI thread only.

func New

func New(cfg Config) *App

New makes the window's state; Start connects it.

func (*App) RequestClose

func (a *App) RequestClose(done func())

RequestClose saves what is unsaved, and calls done once the window may close: at once when every note reached notesd, else when the user says so (docs/design/app.md#operational-notes).

func (*App) Start

func (a *App) Start()

Start connects to notesd.

func (*App) View

func (a *App) View(c *ui.Context)

View draws the window.

type Config

type Config struct {
	Env      notes.Env
	Dial     session.Dialer
	Getenv   system.Getenv
	Blobs    string // notesd's blob store
	Version  string
	Seq      int64
	ConfigAt string // the preferences' directory
	StateAt  string // the state's directory
	// SetTitle sets the window's title; Close closes it; Quit ends the app.
	SetTitle func(string)
	Close    func()
	Quit     func()
	// PickFolder asks for a folder, "" when cancelled; OpenURL and OpenFile
	// open a web link and a vault file outside the app, the link as
	// system.WebURL returned it; Copy puts text on the clipboard.
	PickFolder func(title string) string
	OpenURL    func(url string) error
	OpenFile   func(root, path string) error
	Copy       func(text string)
	Clipboard  editor.Clipboard
	PickFiles  func() []string
}

Config is what the window needs of its surroundings.

Jump to

Keyboard shortcuts

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