From 9189fcde04e6051910e92d93bde0cde9172b851d Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 22 May 2019 19:05:25 -0700 Subject: start moving everything into a common structure (gui.Data) Signed-off-by: Jeff Carr --- gui.go | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'gui.go') diff --git a/gui.go b/gui.go index 245749a..0795258 100644 --- a/gui.go +++ b/gui.go @@ -12,22 +12,24 @@ var mainwin *ui.Window var maintab *ui.Tab var tabcount int -var Width int var Height int var allButtons []ButtonMap -var internalDS GuiDS -func GetDataStructures() *GuiDS { - return &internalDS -} +// +// All GUI Data Structures and functions that are external +// If you need cross platform support, these might only +// be the safe way to interact with the GUI +// +var Data GuiDataStructure -// All GUI Data Structures that are external -type GuiDS struct { +type GuiDataStructure struct { State string MainWindow *ui.Window + Width int ButtonClick func(int, string) + cloudWindow *ui.Window } type TableColumnData struct { @@ -48,7 +50,7 @@ type ButtonMap struct { } func setupUI() { - mainwin = ui.NewWindow("Cloud Control Panel", Width, Height, false) + mainwin = ui.NewWindow("Cloud Control Panel", Data.Width, Height, false) mainwin.OnClosing(func(*ui.Window) bool { ui.Quit() return true @@ -172,9 +174,6 @@ func DoGUI() { } } -func defaultMouseEvent() { -} - func defaultButtonClick(button *ui.Button) { log.Println("defaultButtonClick() button =", button) for key, foo := range allButtons { -- cgit v1.2.3