diff --git a/ui/context.go b/ui/context.go index d37bd5c..3792ce6 100644 --- a/ui/context.go +++ b/ui/context.go @@ -12,6 +12,7 @@ type Context interface { Overlays() *Overlays Quit() Renderer() Renderer + Resources() Resources ShowTooltip(t string) Style() *Style Textures() *Textures @@ -71,6 +72,8 @@ func (c *context) Overlays() *Overlays { return c.overlays } func (c *context) Renderer() Renderer { return c.renderer } +func (c *context) Resources() Resources { return c.renderer.Resources() } + func (c *context) ShowTooltip(t string) { c.tooltip.Text = t } diff --git a/ui/ui.go b/ui/ui.go index 040050d..134c0ec 100644 --- a/ui/ui.go +++ b/ui/ui.go @@ -13,6 +13,9 @@ func Run(r Renderer, s *Style, view Control) error { // RunWait runs the application loop and conditionally waits on events before rendering. func RunWait(r Renderer, s *Style, view Control, wait bool) error { + if s == nil { + s = DefaultStyle() + } ctx := newContext(r, s, view) defer ctx.Destroy()