-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwinControl.go
More file actions
48 lines (40 loc) · 1016 Bytes
/
winControl.go
File metadata and controls
48 lines (40 loc) · 1016 Bytes
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
package main
import (
"fmt"
"os"
dlg "github.com/sqweek/dialog"
imgui "github.com/AllenDang/cimgui-go"
)
func save() {
file, err := dlg.File().Title("Save As").Filter("All Files", "*").Save()
fmt.Println(file)
if err != nil {
fmt.Println("Error:", err)
}
}
func load() {
file, err := dlg.File().Title("Load").Filter("All Files", "*").Load()
fmt.Println(file)
if err != nil {
fmt.Println("Error:", err)
}
}
func winControl() {
imgui.SetNextWindowPosV(imgui.NewVec2(40, 40), imgui.CondOnce, imgui.NewVec2(0, 0))
imgui.SetNextWindowSizeV(imgui.NewVec2(300, 1000), imgui.CondOnce)
imgui.BeginV("Control Panel", nil, imgui.WindowFlagsNoResize+imgui.WindowFlagsNoCollapse+imgui.WindowFlagsNoDocking)
if imgui.Button("exit") {
os.Exit(0)
}
if imgui.Button("save") {
save()
}
if imgui.Button("load") {
load()
}
if imgui.IsKeyPressed(imgui.KeyQ){
os.Exit(1)
}
imgui.Text(fmt.Sprintf("selpin:%v", selected+1))
imgui.End()
}