summaryrefslogtreecommitdiff
path: root/libnotify.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-03-03 23:50:11 -0600
committerJeff Carr <[email protected]>2025-03-03 23:50:11 -0600
commit6127fa1cbb8a68f0b125f50b760822828c7f20e5 (patch)
tree0d636d5b50a84a8969bc4e854a6532680c701726 /libnotify.go
parent54bbe72aa8fe60c21e3bca46a5455a2965859c5b (diff)
try out sync.Once
Diffstat (limited to 'libnotify.go')
-rw-r--r--libnotify.go14
1 files changed, 6 insertions, 8 deletions
diff --git a/libnotify.go b/libnotify.go
index 487c429..5bfa077 100644
--- a/libnotify.go
+++ b/libnotify.go
@@ -1,10 +1,8 @@
-// Copyright 2014 The gocui Authors. All rights reserved.
// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
// Use of this source code is governed by the GPL 3.0
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
+// this file implements a libnotify-like menu
+// also there is SIGWINCH resizing
package main
import (
@@ -52,12 +50,12 @@ func makeNewInternalWidget(wId int) *guiWidget {
return tk
}
-func makeNotifyClock(wId int) {
+func makeNotifyClock() {
if me.treeRoot == nil {
log.Info("gogui makeClock() error. treeRoot == nil")
return
}
- me.notify.clock.tk = makeNewInternalWidget(wId)
+ me.notify.clock.tk = makeNewInternalWidget(me.notify.clock.wId)
me.notify.clock.tk.dumpWidget("init() clock")
me.notify.clock.tk.MoveToOffset(0, 0)
me.notify.clock.tk.labelN = time.Now().Format("15:04:05")
@@ -69,12 +67,12 @@ func makeNotifyClock(wId int) {
}
-func makeNotifyMenu(wId int) {
+func makeNotifyMenu() {
if me.treeRoot == nil {
log.Info("gogui makeClock() error. treeRoot == nil")
return
}
- me.notify.menu.tk = makeNewInternalWidget(wId)
+ me.notify.menu.tk = makeNewInternalWidget(me.notify.menu.wId)
me.notify.menu.tk.dumpWidget("init() menu")
w, _ := me.baseGui.Size()
me.notify.menu.tk.MoveToOffset(w-5, me.notify.menu.offsetH)