blob: bf4a2cf36a51f90fa46e77ff28b2d5e27ba81ea2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
package gui
import (
"log"
)
import toolkit "git.wit.org/wit/gui/toolkit/andlabs"
// the _ means we only need this for the init()
const Xaxis = 0 // box that is horizontal
const Yaxis = 1 // box that is vertical
func init() {
log.Println("gui.init() has been run")
Config.counter = 0
Config.prefix = "wit"
Config.DebugNode = false
Config.DebugTabs = false
title := "master"
w := 640
h := 480
f := StandardClose
Config.master = addNode(title, w, h)
Config.master.custom = f
Config.master.Dump()
}
func Main(f func()) {
log.Println("Starting gui.Main() (using gtk via andlabs/ui)")
toolkit.Main(f)
}
// Other goroutines must use this to access the GUI
//
// You can not acess / process the GUI thread directly from
// other goroutines. This is due to the nature of how
// Linux, MacOS and Windows work (they all work differently. suprise. surprise.)
// For example: gui.Queue(NewWindow())
func Queue(f func()) {
log.Println("Sending function to gui.Main() (using gtk via andlabs/ui)")
toolkit.Queue(f)
}
|