open and close windows on linux for the VM
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
25757a812f
commit
38185c3156
|
@ -0,0 +1 @@
|
||||||
|
*.swp
|
6
gui.go
6
gui.go
|
@ -142,6 +142,12 @@ func mouseClick(b *ButtonMap) {
|
||||||
createVmBox(Data.cloudTab, b.VM)
|
createVmBox(Data.cloudTab, b.VM)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (b.Action == "WINDOW CLOSE") {
|
||||||
|
b.W.Hide()
|
||||||
|
// TODO: fix this (seems to crash? maybe because we are in the button here?)
|
||||||
|
// b.W.Destroy()
|
||||||
|
return
|
||||||
|
}
|
||||||
if (b.Action == "ADD") {
|
if (b.Action == "ADD") {
|
||||||
log.Println("\tgui.mouseClick() SHOULD ADD VM HERE?")
|
log.Println("\tgui.mouseClick() SHOULD ADD VM HERE?")
|
||||||
}
|
}
|
||||||
|
|
|
@ -239,12 +239,19 @@ func ShowVM() {
|
||||||
name := Data.CurrentVM.Name
|
name := Data.CurrentVM.Name
|
||||||
log.Println("ShowVM() START Data.CurrentVM=", Data.CurrentVM)
|
log.Println("ShowVM() START Data.CurrentVM=", Data.CurrentVM)
|
||||||
VMwin := ui.NewWindow("VM " + name, 500, 300, false)
|
VMwin := ui.NewWindow("VM " + name, 500, 300, false)
|
||||||
|
|
||||||
|
// create a 'fake' button entry for the mouse clicks
|
||||||
|
var newButtonMap ButtonMap
|
||||||
|
newButtonMap.Action = "WINDOW CLOSE"
|
||||||
|
newButtonMap.W = VMwin
|
||||||
|
Data.AllButtons = append(Data.AllButtons, newButtonMap)
|
||||||
|
|
||||||
VMwin.OnClosing(func(*ui.Window) bool {
|
VMwin.OnClosing(func(*ui.Window) bool {
|
||||||
|
mouseClick(&newButtonMap)
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
ui.OnShouldQuit(func() bool {
|
ui.OnShouldQuit(func() bool {
|
||||||
VMwin.Destroy()
|
mouseClick(&newButtonMap)
|
||||||
VMwin = nil
|
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -101,6 +101,8 @@ type ButtonMap struct {
|
||||||
B *ui.Button
|
B *ui.Button
|
||||||
FB *ui.FontButton
|
FB *ui.FontButton
|
||||||
A *ui.Area
|
A *ui.Area
|
||||||
|
W *ui.Window
|
||||||
|
|
||||||
Account *pb.Account
|
Account *pb.Account
|
||||||
VM *pb.Event_VM
|
VM *pb.Event_VM
|
||||||
Action string // what type of button
|
Action string // what type of button
|
||||||
|
|
Loading…
Reference in New Issue