blob: 1e0e3d88dabe6667f029409d95fe46a608e644b6 (
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
49
50
51
52
53
54
55
56
57
58
|
// Copyright 2014 The gocui Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"os"
)
func OnExit(f func(string)) {
Custom = f
}
func Init() {
log("Init() of democui")
}
func Exit() {
g.Close()
}
func mouseClick(name string) {
// output screws up the console. Need to fix this by redirecting all console output to a file from log.Println()
// log.Println("g.Close()")
// g.Close()
log("Found andlabs Running custom function for the mouse click")
Custom(name)
// panic("got andlabs")
}
func Main(f func()) {
log("start Init()")
outf, err := os.OpenFile("/tmp/witgui.log", os.O_RDWR | os.O_CREATE | os.O_APPEND, 0666)
if err != nil {
exit("error opening file: %v", err)
}
defer outf.Close()
setOutput(outf)
log("This is a test log entry")
MouseMain()
}
/*
func StartConsoleMouse() {
defer g.Close()
log("start Main()")
if err := g.MainLoop(); err != nil && !errors.Is(err, gocui.ErrQuit) {
exit(err)
}
log("exit Main()")
}
*/
|