calls back on button clicks
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
7ea694b086
commit
72c316dc99
1
gui.go
1
gui.go
|
@ -21,6 +21,7 @@ type GuiDataStructure struct {
|
|||
Width int
|
||||
Height int
|
||||
ButtonClick func(int, string)
|
||||
CurrentVM string
|
||||
|
||||
cloudWindow *ui.Window
|
||||
mainwin *ui.Window
|
||||
|
|
|
@ -10,7 +10,6 @@ import "runtime"
|
|||
import "github.com/andlabs/ui"
|
||||
import _ "github.com/andlabs/ui/winmanifest"
|
||||
|
||||
// var splashWin *ui.Window
|
||||
var MyArea *ui.Area
|
||||
|
||||
func ShowSplash() *ui.Window {
|
||||
|
|
13
tabWindow.go
13
tabWindow.go
|
@ -30,16 +30,11 @@ func buttonClick(i int, s string) {
|
|||
log.Println("Figure out what to do here")
|
||||
log.Println("Figure out what to do here")
|
||||
log.Println("Figure out what to do here")
|
||||
/*
|
||||
cloudTab.Delete(0)
|
||||
|
||||
log.Println("Sleep(2000)")
|
||||
time.Sleep(2000 * time.Millisecond)
|
||||
|
||||
smallBox = AddAccountBox(nil, splashClose)
|
||||
cloudTab.InsertAt("Intro", 0, smallBox)
|
||||
cloudTab.SetMargined(0, true)
|
||||
*/
|
||||
if (Data.ButtonClick != nil) {
|
||||
log.Println("Data.ButtonClick() START")
|
||||
Data.ButtonClick(i, s)
|
||||
}
|
||||
}
|
||||
|
||||
func ShowAccountTab() {
|
||||
|
|
|
@ -15,8 +15,6 @@ import _ "github.com/andlabs/ui/winmanifest"
|
|||
|
||||
import "github.com/gookit/config"
|
||||
|
||||
var CurrentVM string
|
||||
|
||||
func (mh *TableData) NumRows(m *ui.TableModel) int {
|
||||
if (config.String("debugging") == "true") {
|
||||
log.Println("NumRows = mh.RowCount = ", mh.RowCount)
|
||||
|
@ -81,8 +79,8 @@ func defaultSetCellValue(mh *TableData, row int, column int) {
|
|||
vmname := mh.Rows[row].HumanData[humanID].Text
|
||||
log.Println("vmname =", vmname)
|
||||
log.Println("defaultSetCellValue() FOUND THE BUTTON!!!!!!! Button was pressed START", row, column)
|
||||
CurrentVM = fmt.Sprintf("%s",vmname)
|
||||
log.Println("CurrentVM =", CurrentVM)
|
||||
Data.CurrentVM = fmt.Sprintf("%s",vmname)
|
||||
log.Println("Data.CurrentVM =", Data.CurrentVM)
|
||||
go ui.Main(ShowVM)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,8 +6,8 @@ import "github.com/andlabs/ui"
|
|||
import _ "github.com/andlabs/ui/winmanifest"
|
||||
|
||||
func ShowVM() {
|
||||
name := CurrentVM
|
||||
log.Println("setupDemoUI() START CurrentVM=", CurrentVM)
|
||||
name := Data.CurrentVM
|
||||
log.Println("setupDemoUI() START Data.CurrentVM=", Data.CurrentVM)
|
||||
VMwin := ui.NewWindow("VM " + name, 500, 300, false)
|
||||
VMwin.OnClosing(func(*ui.Window) bool {
|
||||
return true
|
||||
|
|
Loading…
Reference in New Issue