diff options
Diffstat (limited to 'eventBindings.go')
| -rw-r--r-- | eventBindings.go | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/eventBindings.go b/eventBindings.go index 09bdcbe..4f09e79 100644 --- a/eventBindings.go +++ b/eventBindings.go @@ -5,6 +5,7 @@ package main import ( "syscall" + "time" "github.com/awesome-gocui/gocui" "go.wit.com/log" @@ -76,13 +77,23 @@ func addDropdown() *tree.Node { // use this to test code ideas // put whatever you want here and hit '2' to activate it func theNotsure(g *gocui.Gui, v *gocui.View) error { - if me.dark { - me.dark = false + log.Info("got keypress 2. now what? dark =", me.dark) + if me.clock.tk == nil { + me.clock.tk = makeNewFlagWidget(me.clock.wId) + me.clock.tk.dumpWidget("init() clock") + w, h := me.baseGui.MousePosition() + me.clock.tk.MoveToOffset(w, h) + me.clock.tk.labelN = time.Now().Format("15:04:05") + me.clock.tk.frame = false + me.clock.tk.setColorLabel() + me.clock.tk.Show() + me.clock.active = true + me.clock.tk.dumpWidget("showClock()") } else { - me.dark = true + me.clock.tk.v.Clear() + me.clock.tk.labelN = time.Now().Format("15:04:05") + me.clock.tk.v.WriteString(me.clock.tk.labelN) } - log.Info("got keypress 2. now what? dark =", me.dark) - // findBG() return nil } |
