diff --git a/eventChannel.go b/eventChannel.go index 5c11d2d..8afd2ca 100644 --- a/eventChannel.go +++ b/eventChannel.go @@ -5,30 +5,11 @@ import "log" import "github.com/golang/protobuf/proto" import pb "git.wit.com/wit/witProtobuf" -import "github.com/andlabs/ui" import "git.wit.com/wit/gui" var mychannel chan *pb.Event var currentMessage *pb.Event -/* -var windowsTextVeryLightGrey = color.RGBA{10, 10, 10, 10} -var windowsTextBlack = color.RGBA{200, 200, 200, 200} -var windowsTextWhite = color.RGBA{255, 255, 255, 255} -var windowsTextYellow = color.RGBA{200, 200, 0, 200} -var windowsTextRed = color.RGBA{200, 0, 0, 200} -var windowsTextBlue = color.RGBA{0, 100, 200, 100} -var windowsBgGrey = color.RGBA{100, 100, 100, 142} -var windowsBgBlack = color.RGBA{55, 55, 55, 255} - -var linuxTextBlue = color.RGBA{0, 100, 200, 100} -var linuxTextBlack = color.RGBA{0, 0, 0, 0} -var linuxTextYellow = color.RGBA{200, 200, 0, 200} -var linuxBgMauve = color.RGBA{72, 0, 0, 142} -var linuxBgBlack = color.RGBA{55, 55, 55, 255} -var linuxBgWhite = color.RGBA{0, 0, 0, 0} -*/ - func initChannel() { mychannel = make(chan *pb.Event) } @@ -112,7 +93,7 @@ func setRowValues(mh *gui.TableData, row int, vm *pb.Event_VM) { } */ -func ReadReceivedData(data *pb.Event, mh *gui.TableData, window *ui.Window, tab *ui.Tab) { +func ReadReceivedData(data *pb.Event, mh *gui.TableData, window *gui.GuiWindow) { msgItems := data.GetResults() log.Println("ReadReceivedData() Event msgItems=", msgItems) for _, item := range msgItems { @@ -135,9 +116,10 @@ func ReadReceivedData(data *pb.Event, mh *gui.TableData, window *ui.Window, tab newGuiButton.Action = "SHOW VM" newGuiButton.VM = vm // set the button to this VM newGuiButton.Account = data.Account - newGuiButton.W = window - newGuiButton.T = tab - gui.Data.AllButtons = append(gui.Data.AllButtons, &newGuiButton) + newGuiButton.W = window.UiWindow + newGuiButton.T = window.UiTab + newGuiButton.Box = mh.Box + gui.Data.AllButtons = append(gui.Data.AllButtons, &newGuiButton) mh.Rows[row].HumanData[6].Button = &newGuiButton mh.Rows[row].HumanData[6].VM = vm diff --git a/main.go b/main.go index 28cac94..c99bb59 100644 --- a/main.go +++ b/main.go @@ -391,7 +391,7 @@ func mainMouseClick(b *gui.GuiButton) { // if (count != 0) { name := "Virtual Machines (" + b.Account.Nick + ")" mh := gui.AddVmsTab(gw, name, count, b.Account) - ReadReceivedData(currentMessage, mh, b.W, b.T) + ReadReceivedData(currentMessage, mh, b.GW) // } currentMessage = nil gui.Data.State = "done"