From 2c1db72a6fa47c4b6049506e9bfe84109bf3cc46 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 24 May 2019 00:04:14 -0700 Subject: formating + standard error box Signed-off-by: Jeff Carr --- gui.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'gui.go') diff --git a/gui.go b/gui.go index 77f6f3d..5c887de 100644 --- a/gui.go +++ b/gui.go @@ -23,12 +23,18 @@ type GuiDataStructure struct { ButtonClick func(*ButtonMap) CurrentVM string MyArea *ui.Area + + // general information Version string GitCommit string GoVersion string HomeDir string Debug bool + // official hostname and IPv6 address for this box + Hostname string + IPv6 string + // account entry textboxes AccNick string AccUser string @@ -228,6 +234,23 @@ func CreateAccountButton(account string, custom func(int, string)) *ui.Button { return newB } +func CreateLoginButton(account string, custom func(int, string)) *ui.Button { + name := "Login " + account + newB := ui.NewButton(name) + + newB.OnClicked(defaultButtonClick) + + var newmap ButtonMap + newmap.B = newB + newmap.Note = "LOGIN" + newmap.Name = name + newmap.AccNick = account + newmap.custom = custom + Data.allButtons = append(Data.allButtons, newmap) + + return newB +} + func CreateFontButton(name string, note string, custom func(int, string)) *ui.FontButton { newB := ui.NewFontButton() @@ -271,3 +294,7 @@ func SocketError() { "There was a socket error", "More detailed information can be shown here.") } + +func ErrorWindow(msg1 string, msg2 string) { + ui.MsgBoxError(Data.cloudWindow, msg1, msg2) +} -- cgit v1.2.3