Documentation
¶
Index ¶
- Constants
- Variables
- func Skip(r rune) bool
- type AppMain
- type EventFilter
- type EventFilterFactory
- type RectPainter
- type RunePainter
- type Setting
- func SetFilterFactory(kr EventFilterFactory) Setting
- func SetFont(fnt *giorune.Font) Setting
- func SetMain(mn AppMain) Setting
- func SetRectPainter(cb func(RectPainter) RectPainter) Setting
- func SetRunePainter(cb func(RunePainter) RunePainter) Setting
- func SetWindowFactory(cb func(WindowFactory) WindowFactory) Setting
- func UnblockDisplay() Setting
- type UI
- type Window
- type WindowFactory
Constants ¶
const PncRegisterEnv = "view: backends: bui: env: register: expect settings.Context"
Variables ¶
var DefaultFont = func() *giorune.Font { fc, err := giorune.Embedded.SelectFace( "Go Mono", font.WeightSemibold, font.StyleNormal) stdlib.PanicOn(err, "gini: vw: gui: cannot select font face") return &giorune.Font{ Face: fc, Size: 15, Leading: 30, } }()
var DefaultGlyphs = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZäöüÄÖÜ"
Functions ¶
Types ¶
type AppMain ¶
type AppMain func()
AppMain is the signature of a function called by an gui.UI instance's Display method.
type EventFilterFactory ¶
type EventFilterFactory func(gioapp.FrameEvent) EventFilter
type Setting ¶
type Setting = settingspkg.Setting
func SetFilterFactory ¶
func SetFilterFactory(kr EventFilterFactory) Setting
SetFilterFactory sets the function that maps a frame event to its associated key events allowing to inject mocked key events for testing.
func SetMain ¶
SetMain allows to mock up the main-function used by an gui.UI-instances Display method to avoid giving up the main go routine during testing. Otherwise it defaults to app.Main
func SetRectPainter ¶
func SetRectPainter(cb func(RectPainter) RectPainter) Setting
func SetRunePainter ¶
func SetRunePainter(cb func(RunePainter) RunePainter) Setting
func SetWindowFactory ¶
func SetWindowFactory(cb func(WindowFactory) WindowFactory) Setting
SetWindowFactory allows to inject the window constructor used by an gui.UI instance in order to mock up used windows. Otherwise the default func() { return new(app.Window) } is used.
func UnblockDisplay ¶
func UnblockDisplay() Setting
UnblockDisplay closes the blocker which takes effect if UI.Display has called a non-blocking main function. This is useful to clean up tests.
type UI ¶
type UI struct {
// contains filtered or unexported fields
}
func Apply ¶
Apply given settings ss to given ui instance ui and return ui or fail if one of ss fails. Note ui is created if nil and providing no settings results in a noop.
func Register ¶
func Register(ui *UI, scc *settingspkg.Contexts) *UI
Register given ui at given settings context scc. Register panics if scc already contains an ui. Note ui is create if nil.
func (*UI) Apply ¶ added in v0.7.0
Apply reconfigures given ui's behavior according to set ReConfig rc.Instructions.
func (*UI) WaitForPolling ¶
func (ui *UI) WaitForPolling()
WaitForPolling implements backends.UIer.WaitForPolling.
type WindowFactory ¶
type WindowFactory func() Window
WindowFactory used by an gui.UI instance to create its windows.