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)
|
||||
}
|
||||
}
|
||||
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") {
|
||||
log.Println("\tgui.mouseClick() SHOULD ADD VM HERE?")
|
||||
}
|
||||
|
|
|
@ -239,12 +239,19 @@ func ShowVM() {
|
|||
name := Data.CurrentVM.Name
|
||||
log.Println("ShowVM() START Data.CurrentVM=", Data.CurrentVM)
|
||||
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 {
|
||||
mouseClick(&newButtonMap)
|
||||
return true
|
||||
})
|
||||
ui.OnShouldQuit(func() bool {
|
||||
VMwin.Destroy()
|
||||
VMwin = nil
|
||||
mouseClick(&newButtonMap)
|
||||
return true
|
||||
})
|
||||
|
||||
|
|
|
@ -101,6 +101,8 @@ type ButtonMap struct {
|
|||
B *ui.Button
|
||||
FB *ui.FontButton
|
||||
A *ui.Area
|
||||
W *ui.Window
|
||||
|
||||
Account *pb.Account
|
||||
VM *pb.Event_VM
|
||||
Action string // what type of button
|
||||
|
|
Loading…
Reference in New Issue