diff --git a/eventChannel.go b/eventChannel.go index 99475be..41fa512 100644 --- a/eventChannel.go +++ b/eventChannel.go @@ -10,6 +10,8 @@ import pb "git.wit.com/wit/witProtobuf" import "git.wit.com/wit/gui" +import "github.com/andlabs/ui" + var mychannel chan *pb.Event var currentMessage *pb.Event @@ -73,7 +75,7 @@ func countVMS(data *pb.Event) int { return len(vms) } -func ReadReceivedData(data *pb.Event, mh *gui.TableData) { +func ReadReceivedData(data *pb.Event, mh *gui.TableData, window *ui.Window, tab *ui.Tab) { msgItems := data.GetResults() log.Println("ReadReceivedData() Event msgItems=", msgItems) for _, item := range msgItems { @@ -128,6 +130,8 @@ func ReadReceivedData(data *pb.Event, mh *gui.TableData) { newButtonMap.Action = "SHOW VM" newButtonMap.VM = item // set the button to this VM newButtonMap.Account = data.Account + newButtonMap.W = window + newButtonMap.T = tab gui.Data.AllButtons = append(gui.Data.AllButtons, newButtonMap) mh.Rows[row].HumanData[6].Button = &newButtonMap mh.Rows[row].HumanData[6].VM = item diff --git a/main.go b/main.go index 18573a4..31aafe3 100644 --- a/main.go +++ b/main.go @@ -276,7 +276,7 @@ func mainMouseClick(b *gui.ButtonMap) { log.Println("\tATTEMPTING TO SHOW VM IN WINDOW") go gui.GoShowVM() } else { - log.Println("\tATTEMPTING TO SHOW VM TAB") + log.Println("\tATTEMPTING TO SHOW VM TAB", b.T) gui.CreateVmBox(b.T, b.VM) } } else if (b.Action == "SHOW") { @@ -302,7 +302,7 @@ func mainMouseClick(b *gui.ButtonMap) { if (count != 0) { name := "Virtual Machines (" + b.Account.Nick + ")" mh := gui.AddVmsTab(name, count, b.Account) - ReadReceivedData(currentMessage, mh) + ReadReceivedData(currentMessage, mh, b.W, b.T) } currentMessage = nil gui.Data.State = "done"