summaryrefslogtreecommitdiff
path: root/init.go
diff options
context:
space:
mode:
Diffstat (limited to 'init.go')
-rw-r--r--init.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/init.go b/init.go
index fa57a64..d950806 100644
--- a/init.go
+++ b/init.go
@@ -49,6 +49,7 @@ func init() {
me.dropdown.wId = -77
me.textbox.wId = -55
me.stdout.wId = -4
+ me.clock.wId = -5
me.mouse.mouseUp = true
me.mouse.clicktime = time.Millisecond * 100
@@ -230,16 +231,24 @@ func refreshGocui() {
var lastRefresh time.Time
lastRefresh = time.Now()
for {
- time.Sleep(10 * time.Millisecond)
+ time.Sleep(100 * time.Millisecond)
// log.Info("refresh checking ok")
if !me.ok {
continue
}
- if time.Since(lastRefresh) > 100*time.Millisecond {
+ if time.Since(lastRefresh) > 1000*time.Millisecond {
if me.mouse.mouseUp {
// log.Info("refresh now on mouseUp")
// todo: add logic here to see if the application has changed anything
me.baseGui.Update(testRefresh)
+ if me.clock.tk != nil && !me.showHelp {
+ // also double check the gocui view exists
+ if me.clock.tk.v != nil {
+ me.clock.tk.v.Clear()
+ me.clock.tk.labelN = time.Now().Format("15:04:05")
+ me.clock.tk.v.WriteString(me.clock.tk.labelN)
+ }
+ }
} else {
// log.Info("refresh skip on mouseDown")
// me.baseGui.Update()