A cross-platform splash screen for Go, based on Gio UI
Sometimes you'll need a splash screen, or loading indicator, optionally with a progress bar. gioui-splash is a small widget for Gio UI, supporting:
- any image to be displayed in a non-decorated window
- an optional progress bar to display asynchronous task progress
- tweaking of the position, size, and color of the progress bar
Gio UI is a library for writing cross-platform immediate mode GUI-s in Go.
A minimal example can be run like this:
go run github.com/gesellix/gioui-splash/cmd@latest
gioui-splash.mp4
The example should work on any platform supported by Gio UI, including WebAssembly. See below for details.
The gogio tool simplifies building and packaging your binaries.
go install gioui.org/cmd/gogio@latest
gogio -x -target macos -ldflags "-s -w" -appid splash -icon appicon.png -o splash.app ./cmd
open splash_arm64.app
#open splash_amd64.app
gogio -x -target windows -ldflags "-s -w" -appid splash -icon appicon.png -o splash.exe ./cmd
.\splash.exe
gogio -x -target js -ldflags "-s -w" -appid splash -icon appicon.png -o wasm ./cmd
go run ./wasm
A modern Golang installation is required. Some additional dependencies might be necessary, please consult the documentation at https://gioui.org/doc/install.
A fresh clone can be run like this:
git clone git@github.com:/gesellix/gioui-splash.git
cd guiui-splash
go run ./cmd
- Refactor parts of the example code from cmd/main.go, so that custom Go code (the application code) won't be mixed with UI code.
- Reduce the packaged binary size (can we exclude Gio's themes and text modules?)
- Add tests, maybe using the
gioui.org/gpu/headless
module? - Consider using Gio's widget/material/progressbar - without forgetting about the binary size ;)
MIT License
Thanks to the Gui UI developers for the great project! Please head over to https://gioui.org/doc/contribute if you want to support their work.