Documentation
¶
Index ¶
- func ApplyConfiguredDefaultFont() error
- type App
- func (a *App) AddFocusable(widgets ...graphics.Widget)
- func (a *App) Backend() graphics.Backend
- func (a *App) ClearFocusables()
- func (a *App) Focus(widget graphics.Widget)
- func (a *App) FocusNext()
- func (a *App) FocusPrevious()
- func (a *App) Input() graphics.InputHandler
- func (a *App) Quit()
- func (a *App) Redraw()
- func (a *App) Root() graphics.Widget
- func (a *App) Run() error
- func (a *App) SetBackground(c graphics.Color)
- func (a *App) SetDebugDamage(enabled bool)
- func (a *App) SetDebugFlashColor(c graphics.Color)
- func (a *App) SetDebugFlashFrames(frames int)
- func (a *App) SetFPS(fps int)
- func (a *App) SetRoot(widget graphics.Widget)
- func (a *App) SetTitle(title string)
- func (a *App) Size() (width, height int)
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyConfiguredDefaultFont ¶
func ApplyConfiguredDefaultFont() error
ApplyConfiguredDefaultFont loads config/fonts.ini and sets Default/UI fonts. It always applies bitmap fallback first so rendering remains functional.
Types ¶
type App ¶
type App struct {
OnQuit func()
OnEscape func() // If set, called on Escape instead of quitting.
// contains filtered or unexported fields
}
App represents the main application with a single root widget that fills the entire screen.
func (*App) AddFocusable ¶
AddFocusable registers a widget for keyboard focus (tab navigation). These are typically interactive leaf widgets (buttons, text inputs) that live somewhere inside the root widget tree.
func (*App) ClearFocusables ¶
func (a *App) ClearFocusables()
ClearFocusables removes all registered focusable widgets.
func (*App) FocusNext ¶
func (a *App) FocusNext()
FocusNext moves focus to the next focusable widget.
func (*App) FocusPrevious ¶
func (a *App) FocusPrevious()
FocusPrevious moves focus to the previous focusable widget.
func (*App) Run ¶
Run starts the main application loop. The root widget is resized to fill the entire framebuffer.
func (*App) SetBackground ¶
SetBackground sets the background color.
func (*App) SetDebugDamage ¶
SetDebugDamage enables or disables the damage flash overlay. When enabled, repainted regions flash red and fade out over several frames, similar to Android's "Show surface updates" developer option.
func (*App) SetDebugFlashColor ¶
SetDebugFlashColor sets the flash overlay color (default semi-transparent red).
func (*App) SetDebugFlashFrames ¶
SetDebugFlashFrames sets how many frames each flash persists (default 6).
func (*App) SetRoot ¶
SetRoot sets the single root widget. It will be resized to fill the entire screen when Run() is called.
type Options ¶
type Options struct {
Title string // Window title.
Width int // Window width; 0 = default (800).
Height int // Window height; 0 = default (600).
Backend graphics.Backend // Display backend (required).
Input graphics.InputHandler // Input handler (required).
FPS int // Target FPS; 0 = default (60).
Background graphics.Color // Background color.
BackgroundSet bool // When true, use Background even if it is transparent (0 alpha).
}
Options configures a new application.