app

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: BSD-3-Clause 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

Index

Constants

This section is empty.

Variables

View Source
var (
	MetaIcon    = "" // this will contain base64 encoded icon bytes
	MetaID      = "com.example"
	MetaName    = "Bellui App"
	MetaVersion = "1.0.0"
	MetaBuild   = "1"
)

these internal variables are set by the bellui build command so that the "manifest.pxf" data is readable at runtime.

View Source
var CurrentVariant atomic.Uint64

CurrentVariant contains the system’s theme variant. It is intended for internal use, only!

Functions

func ApplySettings

func ApplySettings(set bellui.Settings, app bellui.App)

ApplySettings ensures that all widgets and themeable objects in an application will be updated for the current theme. It also checks that scale changes are reflected if required

func ApplySettingsWithCallback

func ApplySettingsWithCallback(set bellui.Settings, app bellui.App, onEveryWindow func(w bellui.Window))

ApplySettingsWithCallback ensures that all widgets and themeable objects in an application will be updated for the current theme. It also checks that scale changes are reflected if required. Also it will call `onEveryWindow` on every window interaction

func ApplyThemeTo

func ApplyThemeTo(content core.CanvasObject, canv core.Canvas)

ApplyThemeTo ensures that the specified canvasobject and all widgets and themeable objects will be updated for the current theme.

func DefaultVariant

func DefaultVariant() bellui.ThemeVariant

DefaultVariant returns the systems default bellui.ThemeVariant. Normally, you should not need this. It is extracted out of the root app package to give the settings app access to it.

func RootConfigDir

func RootConfigDir() string

Types

type FocusManager

type FocusManager struct {
	// contains filtered or unexported fields
}

FocusManager represents a standard manager of input focus for a canvas. FocusManager is safe for concurrent use.

func NewFocusManager

func NewFocusManager(c core.CanvasObject) *FocusManager

NewFocusManager returns a new instance of the standard focus manager for a canvas.

func (*FocusManager) Focus

func (f *FocusManager) Focus(obj event.Focusable) bool

Focus focuses the given obj.

func (*FocusManager) FocusGained

func (f *FocusManager) FocusGained()

FocusGained signals to the manager that its content got focus (due to window/overlay switch for instance).

func (*FocusManager) FocusLost

func (f *FocusManager) FocusLost()

FocusLost signals to the manager that its content lost focus (due to window/overlay switch for instance).

func (*FocusManager) FocusNext

func (f *FocusManager) FocusNext()

FocusNext will find the item after the current that can be focused and focus it. If current is nil then the first focusable item in the canvas will be focused.

func (*FocusManager) FocusPrevious

func (f *FocusManager) FocusPrevious()

FocusPrevious will find the item before the current that can be focused and focus it. If current is nil then the last focusable item in the canvas will be focused.

func (*FocusManager) Focused

func (f *FocusManager) Focused() event.Focusable

Focused returns the currently focused object or nil if none.

type Lifecycle

type Lifecycle struct {
	// contains filtered or unexported fields
}

Lifecycle represents the various phases that an app can transition through.

Since: 1.0

func (*Lifecycle) DestroyEventQueue

func (l *Lifecycle) DestroyEventQueue()

DestroyEventQueue destroys the event queue. A no-op when the queue was never initialized — driver initialization can fail before the queue exists, and shutdown must not panic on top of the real error (pre-rebrand tracker #470).

func (*Lifecycle) InitEventQueue

func (l *Lifecycle) InitEventQueue()

InitEventQueue initializes the event queue.

func (*Lifecycle) OnEnteredForeground

func (l *Lifecycle) OnEnteredForeground() func()

OnEnteredForeground returns the focus gained hook, if one is registered.

func (*Lifecycle) OnExitedForeground

func (l *Lifecycle) OnExitedForeground() func()

OnExitedForeground returns the focus lost hook, if one is registered.

func (*Lifecycle) OnStarted

func (l *Lifecycle) OnStarted() func()

OnStarted returns the started hook, if one is registered.

func (*Lifecycle) OnStopped

func (l *Lifecycle) OnStopped() func()

OnStopped returns the stopped hook, if one is registered.

func (*Lifecycle) QueueEvent

func (l *Lifecycle) QueueEvent(fn func())

QueueEvent uses this method to queue up a callback that handles an event. This ensures user interaction events for a given window are processed in order.

func (*Lifecycle) RunEventQueue

func (l *Lifecycle) RunEventQueue(run func(func(), bool))

RunEventQueue runs the event queue. This should called inside a go routine. This function blocks.

func (*Lifecycle) SetOnEnteredForeground

func (l *Lifecycle) SetOnEnteredForeground(f func())

SetOnEnteredForeground hooks into the app becoming foreground.

func (*Lifecycle) SetOnExitedForeground

func (l *Lifecycle) SetOnExitedForeground(f func())

SetOnExitedForeground hooks into the app having moved to the background. Depending on the platform it may still be visible but will not receive keyboard events. On some systems hover or desktop mouse move events may still occur.

func (*Lifecycle) SetOnStarted

func (l *Lifecycle) SetOnStarted(f func())

SetOnStarted hooks into an event that says the app is now running.

func (*Lifecycle) SetOnStopped

func (l *Lifecycle) SetOnStopped(f func())

SetOnStopped hooks into an event that says the app is no longer running.

func (*Lifecycle) SetOnStoppedHookExecuted

func (l *Lifecycle) SetOnStoppedHookExecuted(f func())

SetOnStoppedHookExecuted is an internal function that lets Bellui schedule a clean-up after the user-provided stopped hook. It should only be called once during an application start-up.

func (*Lifecycle) WaitForEvents

func (l *Lifecycle) WaitForEvents()

WaitForEvents wait for all the events. A no-op when the queue was never initialized: there is nothing to drain, and an init-failed driver's shutdown path must exit cleanly instead of dereferencing a nil queue (pre-rebrand tracker #470).

Jump to

Keyboard shortcuts

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