backend

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 14 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 backend runs an app on the platform it is built for, which build tags pick (run_*.go, view_*.go): what nsgo.Run and nsgo.NewView do once they have gathered their options.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(root engine.App, app func(*core.Scope), o Options)

Run runs root, a root view, or app, the app's function, and the platform's event loop, under the launch flags and nsgo dev's client, then starts the app again if it asked to restart (desktop.Restart).

Types

type Options

type Options struct {
	Components core.NativeComponents
	// Fonts are the font files to register, under the app's resources.
	Fonts []string
	// Monitor shows the performance monitor over the app: --nsgo-fps.
	Monitor bool
	// Material is the material behind the main window's content, and Width and Height its size.
	Material      core.WindowMaterial
	Width, Height core.Points
	// Frame is where the main window opens, when it moves.
	Frame core.WindowFrame
	// Constraints limit the main window.
	Constraints core.WindowConstraints
	// Appearance is the appearance the app starts in.
	Appearance core.Appearance
	// Simulate is the OS a web build runs as: --nsgo-os. Other platforms ignore it.
	Simulate core.OS
	// InstanceKey scopes the Windows and Linux instance lock; empty keeps one per app ID.
	InstanceKey string
	// LaunchFiles replaces the Windows and Linux command-line file scan; nil keeps the default.
	LaunchFiles func(args []string) []string
	// HideDock starts the app out of the Dock (macOS).
	HideDock bool
	// Transparent, NoShadow and SkipTaskbar are the main window's (core.WindowOptions).
	Transparent, NoShadow, SkipTaskbar bool
	// Hidden opens the main window without showing it (nsgo.StartHidden).
	Hidden bool
	// Parent is the window NewView's view is made in (Windows).
	Parent uintptr
}

Options are what nsgo.Run's and nsgo.NewView's options set.

type View

type View interface {
	Handle() uintptr
	SetHostEnvironment(engine.HostEnvironment)
	SetTokens(core.Tokens)
	Close()
}

View is a backend's embedded view, which nsgo.View wraps.

func NewView

func NewView(app engine.App, o Options, h engine.HostOptions) View

NewView makes the platform's view showing app, for a host that runs the event loop itself.

Jump to

Keyboard shortcuts

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