summaryrefslogtreecommitdiff
path: root/window.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2021-11-03 22:41:22 -0500
committerJeff Carr <[email protected]>2021-11-03 22:41:22 -0500
commit37c11288f418aafd28d1e85a8f01cf22392f8665 (patch)
treeaa684a9f6294c1559db118c67ead21303cb04eb1 /window.go
parent234f4fbaa3b6014442b039f437da297f9fd404d3 (diff)
GUI: show error windows
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'window.go')
-rw-r--r--window.go24
1 files changed, 17 insertions, 7 deletions
diff --git a/window.go b/window.go
index b776ad6..f22e614 100644
--- a/window.go
+++ b/window.go
@@ -9,16 +9,26 @@ import (
_ "github.com/andlabs/ui/winmanifest"
)
-func (n *Node) MessageWindow2(msg1 string, msg2 string) (*Node) {
- ui.MsgBox(n.uiWindow, msg1, msg2)
- // TODO: make new node
- return n
+func findUiWindow() *ui.Window {
+ for _, node := range Data.NodeMap {
+ if (node.uiWindow != nil) {
+ return node.uiWindow
+ }
+ }
+ return nil
}
-func (n *Node) ErrorWindow2(msg1 string, msg2 string) (*Node) {
- ui.MsgBoxError(n.uiWindow, msg1, msg2)
+func MessageWindow(msg1 string, msg2 string) (*Node) {
+ uiW := findUiWindow()
+ ui.MsgBox(uiW, msg1, msg2)
// TODO: make new node
- return n
+ return nil
+}
+
+func ErrorWindow(msg1 string, msg2 string) (*Node) {
+ uiW := findUiWindow()
+ ui.MsgBoxError(uiW, msg1, msg2)
+ return nil
}
func initNode(title string, x int, y int) *Node {