From 52eb38ae5d8e56e96db4bd7ee31159efd4c5d241 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Tue, 5 May 2020 09:57:19 -0400 Subject: libui: don't require beeper for main content --- lib/ui/ui.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ui/ui.go b/lib/ui/ui.go index 9a9ed14..ee71f8e 100644 --- a/lib/ui/ui.go +++ b/lib/ui/ui.go @@ -17,7 +17,7 @@ type UI struct { invalid int32 // access via atomic } -func Initialize(content DrawableInteractiveBeeper) (*UI, error) { +func Initialize(content DrawableInteractive) (*UI, error) { screen, err := tcell.NewScreen() if err != nil { @@ -52,7 +52,9 @@ func Initialize(content DrawableInteractiveBeeper) (*UI, error) { content.OnInvalidate(func(_ Drawable) { atomic.StoreInt32(&state.invalid, 1) }) - content.OnBeep(screen.Beep) + if beeper, ok := content.(DrawableInteractiveBeeper); ok { + beeper.OnBeep(screen.Beep) + } content.Focus(true) if root, ok := content.(RootDrawable); ok { -- cgit 1.4.1-2-gfad0 n'>main Soul of a tiny new machine. More thorough tests → More comprehensible and rewrite-friendly software → More resilient society.Kartik K. Agaram <vc@akkartik.com>
about summary refs log blame commit diff stats
path: root/html/083scenario_screen_test.mu.html
blob: 9c2757601e14ce7104fb6aea40a0e23420bc766c (plain) (tree)
1
2
3
4
5
6
7
8
9