Cross platform rapid GUI framework for golang based on Dear ImGui and the great golang binding imgui-go.
Any contribution (features, widgets, tutorials, documents and etc...) is appreciated!
giu is built upon GLFW v3.3, so idealy giu could support all platforms that GLFW v3.3 supports.
- Windows (only tested on Windows 10 x64)
- MacOS (only tested on MacOS v10.15)
- Linux (thanks remeh to test it)
- Raspberry pi 3b (thanks sndvaps to test it)
Compare to other Dear ImGui golang bindings, giu has following features:
- Small executable file size (<3mb after upx compression for the example/helloworld demo).
- Live-update during the resizing of OS window (implemented on GLFW 3.3 and OpenGL 3.2).
- Redraw only when user event occurred. Costs only 0.5% CPU usage with 60FPS.
- Declarative UI (see examples for more detail).
- DPI awareness (auto scale font and UI to adapte high DPI monitor).
- Drop in usage, no need to implement render and platform.
- OS clipboard support.
package main
import (
"fmt"
g "github.com/AllenDang/giu"
)
func onClickMe() {
fmt.Println("Hello world!")
}
func onImSoCute() {
fmt.Println("Im sooooooo cute!!")
}
func loop() {
g.SingleWindow("hello world").Layout(
g.Label("Hello world from giu"),
g.Line(
g.Button("Click Me").OnClick(onClickMe),
g.Button("I'm so cute").OnClick(onImSoCute),
),
)
}
func main() {
wnd := g.NewMasterWindow("Hello world", 400, 200, g.MasterWindowFlagsNotResizable, nil)
wnd.Run(loop)
}
Here is result.
The backend of giu depends on OpenGL 3.3, make sure your environment supports it (so far as I known some Virual Machine like VirualBox doesn't support it).
xcode-select --install
go get github.com/AllenDang/giu@master
- Install mingw download here. Thanks @alchem1ster!
- Add the binaries folder of mingw to the path (usually is \mingw64\bin).
- go get github.com/AllenDang/giu@master.
Need help here cause I don't have any linux experience.
go build -ldflags "-s -w" .
go build -ldflags "-s -w -H=windowsgui -extldflags=-static" .
- Install mingw-64.
brew install mingw-w64
- Prepare and embed application icon to executable and build.
cat > YourExeName.rc << EOL
id ICON "./res/app_win.ico"
GLFW_ICON ICON "./res/app_win.ico"
EOL
x86_64-w64-mingw32-windres YourExeName.rc -O coff -o YourExeName.syso
GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ HOST=x86_64-w64-mingw32 go build -ldflags "-s -w -H=windowsgui -extldflags=-static" -p 4 -v -o YourExeName.exe
rm YourExeName.syso
rm YourExeName.rc
Check Wiki
All kinds of pull request (document, demo, screenshots, code, etc...) are more then welcome!
PipeIt is a text transformation, conversion, cleansing and extraction tool.
NVTool is a video encoding tool based on NVEncC.