From 3e2805017e0f21b462eca2002690b68744127800 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 25 Feb 2024 18:38:47 -0600 Subject: print a simple text colsole banner on init() --- Makefile | 2 +- main.go | 23 +++++++++++++++++++++++ release-logo.png | Bin 0 -> 116000 bytes 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 release-logo.png diff --git a/Makefile b/Makefile index 43332b5..ebefe43 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,11 @@ all: + @GO111MODULE=off go build @echo @echo This is the core gui package 'go.wit.com/gui/gui' @echo @echo It creates a binary tree of widgets @echo The widgets are things like Windows, Buttons, Labels, etc @echo - @GO111MODULE=off go build note-about-golang: ifeq ($(GO111MODULE),) diff --git a/main.go b/main.go index 9474290..fe6ebc6 100644 --- a/main.go +++ b/main.go @@ -31,9 +31,32 @@ func init() { me.flag.WidgetType = widget.Stdout me.guiChan = make(chan widget.Action, 1) + + fmt.Println("GO GUI version ", showVersion() + "") + log.Sleep(1) go watchCallback() } +// what genius figured this out? +// originally from github.com/dimasma0305/GoFetch +func showVersion() string { + // var runes rune + // color1 := "\x1b[0;29m  \x1b[0m" + // runes = []rune(color1) + // view.WriteRunes(runes) + + color1 := "\x1b[0;29m  \x1b[0m" + color2 := "\x1b[0;31m  \x1b[0m" + color3 := "\x1b[0;32m  \x1b[0m" + color4 := "\x1b[0;33m  \x1b[0m" + color5 := "\x1b[0;34m  \x1b[0m" + color6 := "\x1b[0;35m  \x1b[0m" + color7 := "\x1b[0;36m  \x1b[0m" + color8 := "\x1b[0;37m  \x1b[0m" + + return color1 + " " + color2 + " " + color3 + " " + color4 + " " + color5 + " " + color6 + " " + color7 + " " + color8 +} + // lookup the widget by the id sent from the toolkit func (n *Node) findId(i int) *Node { if n == nil { diff --git a/release-logo.png b/release-logo.png new file mode 100644 index 0000000..5b8da73 Binary files /dev/null and b/release-logo.png differ -- cgit v1.2.3