Cross platform rapid GUI framework for golang based on Dear ImGui.

Overview

giu

Join the chat at https://gitter.im/AllenDang-giu/community Go Report Card Build Status Godoc Card

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!

Supported Platforms

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)

Features

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.

Screenshot Screenshot1 Screenshot2

Hello world

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.

Helloworld

Install

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).

MacOS

xcode-select --install
go get github.com/AllenDang/[email protected]

Windows

  1. Install mingw download here. Thanks @alchem1ster!
  2. Add the binaries folder of mingw to the path (usually is \mingw64\bin).
  3. go get github.com/AllenDang/[email protected]

Linux

Need help here cause I don't have any linux experience.

Deploy

Build MacOS version on MacOS.

go build -ldflags "-s -w" .

Build Windows version on Windows.

go build -ldflags "-s -w -H=windowsgui -extldflags=-static" .

Build Windows version on MacOS.

  1. Install mingw-64.
brew install mingw-w64
  1. 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

Document

Check Wiki

Contribution

All kinds of pull request (document, demo, screenshots, code, etc...) are more then welcome!

Projects using giu

PipeIt

PipeIt is a text transformation, conversion, cleansing and extraction tool.

PipeIt Demo

NVTool

NVTool is a video encoding tool based on NVEncC.

NVTool Screenshots

Comments
  • [bug] Kind a glitch of desktop background from widgets when the main window has a transparent color

    [bug] Kind a glitch of desktop background from widgets when the main window has a transparent color

    What happend?

    Hey there,

    i'm not 100% sure if this is a bug, but i want to create a main window with a slight transparent color. I did the following:

    • Created a new main window with the flag g.MasterWindowFlagsTransparent
    • Set the main window background color to something transparent like wnd.SetBgColor(color.RGBA{A: 175})
    • Create a window with some widgets
    • Then, the background behind the actual main window will kinda glitch through the created window (see following image as reference)

    grafik

    I'll added the code that i used to take the screenshot to reproduce/test.

    Any ideas to fix this issue?

    Kind regards

    Code example

    main.go
    package main
    
    import (
    	g "github.com/AllenDang/giu"
    	"image/color"
    )
    
    var (
    	foo  string
    	foo2 bool
    )
    
    func loop() {
    	//Render one window
    	g.Window("Test window").Layout(
    		g.Label("Hello World! I'm a label"),
    		g.Selectable("Hello World! I'm a selectable"),
    		g.InputText(&foo).Hint("You can enter something here..."),
    		g.Checkbox("Check me!", &foo2),
    		g.Button("Press me!"),
    		g.RadioButton("One lonely radio button!", foo2),
    
    		g.Table().Columns(
    			g.TableColumn("Col1"),
    			g.TableColumn("Col2"),
    			g.TableColumn("Col3"),
    		).Rows(
    			g.TableRow(
    				g.Label("Row1"),
    				g.Label("Row1"),
    				g.Label("Row1"),
    			),
    			g.TableRow(
    				g.Label("Row2"),
    				g.Label("Row2"),
    				g.Label("Row2"),
    			),
    			g.TableRow(
    				g.Label("Row3"),
    				g.Label("Row3"),
    				g.Label("Row3"),
    			),
    		).Size(400, 200),
    
    		g.Child().Layout(
    			g.Checkbox("Checkbox inside a child!", &foo2),
    			g.Checkbox("Checkbox inside a child!", &foo2),
    			g.Checkbox("Checkbox inside a child!", &foo2),
    			g.Checkbox("Checkbox inside a child!", &foo2),
    			g.Checkbox("Checkbox inside a child!", &foo2),
    			g.Checkbox("Checkbox inside a child!", &foo2),
    			g.Checkbox("Checkbox inside a child!", &foo2),
    		).Size(200, 100),
    	)
    
    	//Render another window
    	g.Window("I have no focus").Size(200, 100).Layout(
    		g.Checkbox("I'm a checkbox!", &foo2),
    	)
    }
    
    func main() {
    	//Main window (set flag transparent, otherwise transparent color will not work)
    	wnd := g.NewMasterWindow("Hello World!", 800, 600, g.MasterWindowFlagsTransparent)
    
    	//Set main window slightly transparent
    	wnd.SetBgColor(color.RGBA{A: 175})
    
    	wnd.Run(loop)
    }
    

    To Reproduce

    1. Run my demo
    2. You should see the same as my screenshot (if ur background is green :D)

    Version

    master (v0.6.2)

    OS

    Windows 11 Go 1.18

    bug 
    opened by SeyRyuu 29
  • Unsafe pointer arithmetic

    Unsafe pointer arithmetic

    I've compiled application with -race and it crashed right before showing up GUI.

    fatal error: checkptr: unsafe pointer arithmetic
    
    goroutine 1 [running, locked to thread]:
    runtime.throw(0xce6324, 0x23)
            /usr/lib/go/src/runtime/panic.go:1112 +0x72 fp=0xc00011fa18 sp=0xc00011f9e8 pc=0x483d12
    runtime.checkptrArithmetic(0x1, 0x0, 0x0, 0x0)
            /usr/lib/go/src/runtime/checkptr.go:24 +0xce fp=0xc00011fa48 sp=0xc00011fa18 pc=0x456fde
    github.com/AllenDang/giu/imgui.TextureID.handle(...)
            /home/pztrn/projects/go/pkg/mod/github.com/!allen!dang/[email protected]/imgui/TextureID.go:24
    github.com/AllenDang/giu/imgui.FontAtlas.SetTextureID.func1(0x27280e0, 0x1)
            /home/pztrn/projects/go/pkg/mod/github.com/!allen!dang/[email protected]/imgui/FontAtlas.go:174 +0x78 fp=0xc00011fa88 sp=0xc00011fa48 pc=0xa3c3c8
    github.com/AllenDang/giu/imgui.FontAtlas.SetTextureID(0x27280e0, 0x1)
            /home/pztrn/projects/go/pkg/mod/github.com/!allen!dang/[email protected]/imgui/FontAtlas.go:174 +0x43 fp=0xc00011faa8 sp=0xc00011fa88 pc=0xa35683
    github.com/AllenDang/giu/imgui.(*OpenGL3).createFontsTexture(0xc000074230)
            /home/pztrn/projects/go/pkg/mod/github.com/!allen!dang/[email protected]/imgui/RendererOpenGL3.go:338 +0x3e5 fp=0xc00011fb50 sp=0xc00011faa8 pc=0xa289f5
    github.com/AllenDang/giu/imgui.(*OpenGL3).createDeviceObjects(0xc000074230)
            /home/pztrn/projects/go/pkg/mod/github.com/!allen!dang/[email protected]/imgui/RendererOpenGL3.go:292 +0xd26 fp=0xc00011fcc8 sp=0xc00011fb50 pc=0xa28256
    github.com/AllenDang/giu/imgui.NewOpenGL3(0x2724368, 0x3fe00000, 0xb, 0x258, 0x1f4)
            /home/pztrn/projects/go/pkg/mod/github.com/!allen!dang/[email protected]/imgui/RendererOpenGL3.go:46 +0x1f5 fp=0xc00011fd50 sp=0xc00011fcc8 pc=0xa25485
    github.com/AllenDang/giu.NewMasterWindowWithBgColor(0xcd52c1, 0xb, 0x258, 0x1f4, 0x1, 0xc00011fec0, 0x0, 0x7fd2ff3d8108)
            /home/pztrn/projects/go/pkg/mod/github.com/!allen!dang/[email protected]/MasterWindow.go:54 +0x263 fp=0xc00011fe30 sp=0xc00011fd50 pc=0xa53723
    github.com/AllenDang/giu.NewMasterWindow(...)
            /home/pztrn/projects/go/pkg/mod/github.com/!allen!dang/[email protected]/MasterWindow.go:25
    
    help wanted 
    opened by pztrn 26
  • how can I make custom widget occupying some width/height

    how can I make custom widget occupying some width/height

    I have viewed examples/customwidget.go. If I commented out two lines. It will see picture below.

    So it's g.InvisibleButton who make this custom widget moved the CursorPos.

    There is g.GetCursorPos() to get canvas cursor position. But we have no g.SetCursorPos() to set cursor position.

    My question is: if I create a chart, how can I make my widget occupying some width/height?

    	// Place a invisible button to be a placeholder for events
    	// buttonWidth := float32(radius) * 2
    	// g.InvisibleButton(c.id).Size(buttonWidth, buttonWidth).OnClick(c.clicked).Build()
    

    782BBCDE-5BD5-4F47-A95F-AE529BC0F343

    Thanks.

    opened by daiwhea 23
  • Static linking

    Static linking

    Was wondering if anyone ever did manage to compile a giu/imgui-go binary for linux with static-linking. You can see the message I sent to one of my friends (of course they had no clue) (I was using imgui-go at the time but the "problem" is the same with giu):

    trying to compile an imgui-go (https://github.com/inkyblackness/imgui-go/) project with static linking.
    the normal command, go build -x -o dist/ src/main.go works fine.
    
    imgui-go is go bindings for Dear ImGui, which of course needs to use CGO.
    it depends on GLFW, Xrandr & some other GL stuff.
    
    The following command is what I first tried to use:
    go build -tags osusergo,netgo,static -ldflags="-linkmode external" -x -o dist/ src/main.go
    
    it seems to work just fine on my machine, but when running it on another machine it just exits with "no such file or directory", so it seems that I am not properly doing the static linking, but how would I go on about doing that? 
    

    I can say that both the machines run Linux distributions (compile machine is Fedora/Alpine and the other test machine is Artix). They both have the same Go version (1.17.5) even though I know it has nothing to do with that dysfunction.

    This is more of an "ask for help" than an "issue" to be honest, I just don't know where else to ask.

    opened by phorcys420 21
  • fatal panic on starting giu

    fatal panic on starting giu

    Yo, I just noticed, that giu doesn't start on my machine anymore. When I'm running any example/code, it crashes with a following panic:

    widgets: imgui.cpp:7192: void ImGui::ErrorCheckNewFrameSanityChecks(): Assertion `g.IO.Fonts->Fonts[0]->IsLoaded() && "Font Atlas not built. Did you call io.Fonts->GetTexDataAsRGBA32() / GetTexDataAsAlpha8()?"' failed.
    SIGABRT: abort
    PC=0x7f31fc71b9e5 m=0 sigcode=18446744073709551610
    signal arrived during cgo execution
    
    goroutine 1 [syscall, locked to thread]:
    runtime.cgocall(0x634e60, 0xc00011fda0, 0x4000)
    	/usr/local/go/src/runtime/cgocall.go:154 +0x5b fp=0xc00011fd70 sp=0xc00011fd38 pc=0x48673b
    github.com/AllenDang/imgui-go._Cfunc_iggNewFrame()
    	_cgo_gotypes.go:4742 +0x3c fp=0xc00011fda0 sp=0xc00011fd70 pc=0x57d1dc
    github.com/AllenDang/imgui-go.NewFrame(...)
    	/home/username/go/pkg/mod/github.com/!allen!dang/[email protected]/imgui.go:30
    github.com/AllenDang/giu.(*MasterWindow).render(0xc00031a000)
    	/run/media/username/SALATKA/mystuff/test/giu/MasterWindow.go:182 +0x9b fp=0xc00011fe10 sp=0xc00011fda0 pc=0x62505b
    github.com/AllenDang/giu.(*MasterWindow).run.func1()
    	/run/media/username/SALATKA/mystuff/test/giu/MasterWindow.go:201 +0x59 fp=0xc00011fe50 sp=0xc00011fe10 pc=0x629eb9
    github.com/faiface/mainthread.Call.func1()
    	/home/username/go/pkg/mod/github.com/faiface/[email protected]/mainthread.go:63 +0x2f fp=0xc00011fe80 sp=0xc00011fe50 pc=0x58b48f
    github.com/faiface/mainthread.Run(0xc0003184e0)
    	/home/username/go/pkg/mod/github.com/faiface/[email protected]/mainthread.go:44 +0xb1 fp=0xc00011ff08 sp=0xc00011fe80 pc=0x58b211
    github.com/AllenDang/giu.(*MasterWindow).Run(0xc00031a000, 0x8dcd58)
    	/run/media/username/SALATKA/mystuff/test/giu/MasterWindow.go:258 +0x65 fp=0xc00011ff28 sp=0xc00011ff08 pc=0x625305
    main.main()
    	/run/media/username/SALATKA/mystuff/test/giu/examples/widgets/widgets.go:211 +0x18f fp=0xc00011ff88 sp=0xc00011ff28 pc=0x63196f
    runtime.main()
    	/usr/local/go/src/runtime/proc.go:225 +0x256 fp=0xc00011ffe0 sp=0xc00011ff88 pc=0x4bb4f6
    runtime.goexit()
    	/usr/local/go/src/runtime/asm_amd64.s:1371 +0x1 fp=0xc00011ffe8 sp=0xc00011ffe0 pc=0x4ed101
    
    goroutine 18 [chan receive]:
    github.com/faiface/mainthread.Call(0xc000240ba0)
    	/home/username/go/pkg/mod/github.com/faiface/[email protected]/mainthread.go:66 +0xc5
    github.com/AllenDang/giu.(*MasterWindow).run(0xc00031a000)
    	/run/media/username/SALATKA/mystuff/test/giu/MasterWindow.go:199 +0xa5
    github.com/AllenDang/giu.(*MasterWindow).Run.func1()
    	/run/media/username/SALATKA/mystuff/test/giu/MasterWindow.go:263 +0x4d
    github.com/faiface/mainthread.Run.func1(0xc0003184e0, 0xc000320000)
    	/home/username/go/pkg/mod/github.com/faiface/[email protected]/mainthread.go:37 +0x27
    created by github.com/faiface/mainthread.Run
    	/home/username/go/pkg/mod/github.com/faiface/[email protected]/mainthread.go:36 +0xa5
    
    rax    0x0
    rbx    0x7f31fc593740
    rcx    0x7f31fc71b9e5
    rdx    0x0
    rdi    0x2
    rsi    0x7ffd630b7c70
    rbp    0x7f31fc871680
    rsp    0x7ffd630b7c70
    r8     0x0
    r9     0x7ffd630b7c70
    r10    0x8
    r11    0x246
    r12    0x91a372
    r13    0x1c18
    r14    0x91e618
    r15    0xffffffffffffffff
    rip    0x7f31fc71b9e5
    rflags 0x246
    cs     0x33
    fs     0x0
    gs     0x0
    exit status 2
    

    I'm running examples/widgets.

    my system:

    • OS: Fedora 33
    • desktop: gnome-shell 3.38.4
    opened by gucio321 19
  • examples/dynamicloadfont: example crashes

    examples/dynamicloadfont: example crashes

    Hi! I wanted to run examples/dynmiacloadfont but it panics:

    dynamicloadfont: imgui.cpp:7112: void ImGui::ErrorCheckNewFrameSanityChecks(): Assertion `g.IO.Fonts->Fonts[0]->IsLoaded() && "Font Atlas not built. Did you call io.Fonts->GetTexDataAsRGBA32() / GetTexDataAsAlpha8()?"' failed.
    SIGABRT: abort
    PC=0x7f43aff019d5 m=0 sigcode=18446744073709551610
    signal arrived during cgo execution
    
    goroutine 1 [syscall, locked to thread]:
    runtime.cgocall(0x6131f0, 0xc0000cddb8, 0x4000)
            /usr/local/go/src/runtime/cgocall.go:154 +0x5b fp=0xc0000cdd88 sp=0xc0000cdd50 pc=0x48567b
    github.com/AllenDang/imgui-go._Cfunc_iggNewFrame()
            _cgo_gotypes.go:4546 +0x3c fp=0xc0000cddb8 sp=0xc0000cdd88 pc=0x571d5c
    github.com/AllenDang/imgui-go.NewFrame(...)
            /home/user/go/pkg/mod/github.com/!allen!dang/[email protected]/imgui.go:28
    github.com/AllenDang/giu.(*MasterWindow).render(0xc000186000)
            /home/user/git/d2/me/giu/MasterWindow.go:174 +0x96 fp=0xc0000cde28 sp=0xc0000cddb8 pc=0x60faf6
    github.com/AllenDang/giu.(*MasterWindow).run.func1()
            /home/user/git/d2/me/giu/MasterWindow.go:193 +0x59 fp=0xc0000cde68 sp=0xc0000cde28 pc=0x610219
    github.com/faiface/mainthread.Call.func1()
            /home/user/go/pkg/mod/github.com/faiface/[email protected]/mainthread.go:63 +0x2f fp=0xc0000cde98 sp=0xc0000cde68 pc=0x57804f
    github.com/faiface/mainthread.Run(0xc00000e4c8)
            /home/user/go/pkg/mod/github.com/faiface/[email protected]/mainthread.go:44 +0xb1 fp=0xc0000cdf20 sp=0xc0000cde98 pc=0x577dd1
    github.com/AllenDang/giu.(*MasterWindow).Run(0xc000186000, 0x8aca58)
            /home/user/git/d2/me/giu/MasterWindow.go:250 +0x65 fp=0xc0000cdf40 sp=0xc0000cdf20 pc=0x60fda5
    main.main()
            /home/user/git/d2/me/giu/examples/dynmiacloadfont/dynamicloadfont.go:34 +0x73 fp=0xc0000cdf88 sp=0xc0000cdf40 pc=0x6108f3
    runtime.main()
            /usr/local/go/src/runtime/proc.go:225 +0x256 fp=0xc0000cdfe0 sp=0xc0000cdf88 pc=0x4ba0f6
    runtime.goexit()
            /usr/local/go/src/runtime/asm_amd64.s:1371 +0x1 fp=0xc0000cdfe8 sp=0xc0000cdfe0 pc=0x4ebb81
    
    goroutine 5 [chan receive]:
    github.com/faiface/mainthread.Call(0xc00009af60)
            /home/user/go/pkg/mod/github.com/faiface/[email protected]/mainthread.go:66 +0xc5
    github.com/AllenDang/giu.(*MasterWindow).run(0xc000186000)
            /home/user/git/d2/me/giu/MasterWindow.go:191 +0xa5
    github.com/AllenDang/giu.(*MasterWindow).Run.func1()
            /home/user/git/d2/me/giu/MasterWindow.go:255 +0x4d
    github.com/faiface/mainthread.Run.func1(0xc00000e4c8, 0xc000024120)
            /home/user/go/pkg/mod/github.com/faiface/[email protected]/mainthread.go:37 +0x27
    created by github.com/faiface/mainthread.Run
            /home/user/go/pkg/mod/github.com/faiface/[email protected]/mainthread.go:36 +0xa5
    
    rax    0x0
    rbx    0x7f43afd79740
    rcx    0x7f43aff019d5
    rdx    0x0
    rdi    0x2
    rsi    0x7fff653957b0
    rbp    0x7f43b0057680
    rsp    0x7fff653957b0
    r8     0x0
    r9     0x7fff653957b0
    r10    0x8
    r11    0x246
    r12    0x8e48b2
    r13    0x1bc8
    r14    0x8e8978
    r15    0xffffffffffffffff
    rip    0x7f43aff019d5
    rflags 0x246
    cs     0x33
    fs     0x0
    gs     0x0
    exit status 2
    
    opened by gucio321 19
  • DPI scale - unexpected behavior

    DPI scale - unexpected behavior

    This commit https://github.com/AllenDang/giu/commit/27ecca73d762cacc8bdd23e12dd18c07b76623ab breaks UI rendering on high monitor resolution.

    Before:

    After:

    opened by aleksandrzhiliaev 17
  • test pull requests

    test pull requests

    @allenDang what about a github workflow, which will check if project is able to build? or you can add branch protection rule to master with Require test status from travisCI to prevent unbuildable PR to be merged.

    Originally posted by @gucio321 in https://github.com/AllenDang/giu/issues/314#issuecomment-912970533

    opened by gucio321 15
  • Remove imgui-go, implot, imnodes, ImGuiColorTextEdit from repo

    Remove imgui-go, implot, imnodes, ImGuiColorTextEdit from repo

    @AllenDang what are your thoughts on merging these changes upstream?

    I removed all of the hard copies of the dependencies in favor of importing them via a fork of imgui-go: https://github.com/ianling/imgui-go -- this fork is up-to-date with the upstream imgui-go repo as of yesterday, and also has all of the changes you've made in the giu repo.

    If you are interested in changing to this style, we could merge this PR and I can transfer the fork ianling/imgui-go to your account. All instances of ianling would also need to be changed back to AllenDang

    I think the main benefits of making this change are:

    • reduces clutter by having a clear separation between the low-level CGo wrappers in imgui-go/implot/imnodes/ImGuiColorTextEdit and the clean high-level API provided by giu
    • easier to maintain. If you need to make custom changes to imgui-go (or one of the other C++ libraries), you simply commit the change in the fork and import the new commit in giu. If the official imgui-go repo releases an update, or ImGui itself receives an update, it is very simple to update this fork.
      • you can also update the imgui-go fork separately from giu, and continue building giu from the previous commit if there are breaking changes and you don't have time to update both repos at once.
    opened by ianling 15
  • [Windows] go get github.com/AllenDang/giu fails

    [Windows] go get github.com/AllenDang/giu fails

    Not sure what the requirements are, just following along with the README.

    Error:

    # github.com/AllenDang/giu/imgui
    C:\Users\#####\AppData\Local\Temp\go-build3633627171\b001\_x039.o: In function `ImeSetInputScreenPosFn_DefaultImpl':
    ..\..\..\go\pkg\mod\github.com\!allen!dang\[email protected]\imgui/imgui.cpp:10724: undefined reference to `ImmGetContext'
    ..\..\..\go\pkg\mod\github.com\!allen!dang\[email protected]\imgui/imgui.cpp:10730: undefined reference to `ImmSetCompositionWindow'
    ..\..\..\go\pkg\mod\github.com\!allen!dang\[email protected]\imgui/imgui.cpp:10731: undefined reference to `ImmReleaseContext'
    collect2.exe: error: ld returned 1 exit status
    
    opened by bartimusprimed 15
  • Race condition between texture creation and deletion (via finalizer)

    Race condition between texture creation and deletion (via finalizer)

    Texture creation can randomly fail if another texture happens to be finalizing in the background.

    This is causing deadlocks in our project.

    ~~The deadlock is happening between Texture.release and NewTextureFromRgba.~~ read below

    opened by gravestench 15
  • [bug] Missing MouseButton function for ContextMenu on docking branch

    [bug] Missing MouseButton function for ContextMenu on docking branch

    What happend?

    I just wanted to use the MouseButton func of the ContextMenu widget on the docking branch and noticed that this function is missing. Did the way of using the ContextMenu changed, or is this function missing in the docking branch?

    The code example below works fine when using master branch instead.

    Kind regards

    Code example

    main.go
    package main
    
    import (
    	g "github.com/AllenDang/giu"
    )
    
    func main() {
    	wnd := g.NewMasterWindow("Testing", 600, 400, 0)
    	wnd.Run(loop)
    }
    
    func loop() {
    	g.SingleWindow().Layout(
    		g.Label("Click here"),
    
    		//".MouseButton(...)" is missing
    		//"g.MouseButtonLeft" can be replaced with "cimgui.ImGuiMouseButton_Left" on docking)
    		g.ContextMenu().MouseButton(g.MouseButtonLeft).Layout(
    			g.Label("I'm a context menu"),
    		),
    	)
    }
    

    To Reproduce

    1. Switch to docking branch
    2. Run my demo
    3. Your IDE or at last your compiler will show you the missing .MouseButton(...) part

    Version

    docking

    OS

    Windows 11 x64, Ubuntu x64

    bug 
    opened by SeyRyuu 7
  • How to drag a frameless window or get the monitor size?

    How to drag a frameless window or get the monitor size?

    Sorry, this is not a bug. My issue is:

    I need a narrow frameless window which just take a little part of screen, and I wish put it on the top center. or I can drag it to some place.

    But I don't find a method to get the monitor size to make window center. Or how to drag a frameless window.

    Thanks for your time. s^_^s

    opened by daiwhea 0
  • Component sizing and default background

    Component sizing and default background

    Related problem

    Giu is really surprised at me. It is very good. Its functions are very comprehensive. But I think its default background color is too dark. I suggest you give more choices. I hope the size of the component can be adjusted. The component is a little too small.

    Your request

    It is recommended to add the function of component adjustment, and the function of background color adjustment,

    Alternative solution

    No response

    Additional context

    No response

    enhancement 
    opened by Esword618 2
  • [bug] InputText widget with auto-completion and on change callback, does not callback when auto-completed.

    [bug] InputText widget with auto-completion and on change callback, does not callback when auto-completed.

    What happend?

    When using InputText widget with auto completion and an OnChange() callback. The OnChange callback won't be called when the InputText is auto-completed.

    Code example

    main.go
    package main
    
    import (
    	"fmt"
    
    	g "github.com/AllenDang/giu"
    )
    
    var input string
    
    func main() {
    	mw := g.NewMasterWindow("Test", 500, 500, 0)
    
    	mw.Run(loop)
    }
    
    func loop() {
    	strList := []string{"Hello", "Hallo", "Halo"}
    	g.InputText(&input).OnChange(myCb).AutoComplete(strList).Build()
    }
    
    func myCb() {
    	fmt.Println("My inputtext string:", input)
    }
    
    

    To Reproduce

    1. Run my demo
    2. Type in a 'H'
    3. See the callback get called
    4. Auto complete it
    5. See the callback not being called.

    Version

    master

    OS

    Ubuntu

    bug 
    opened by frenkoes 1
  • [bug] Blurry on M1 Mac with HIDPI

    [bug] Blurry on M1 Mac with HIDPI

    What happend?

    Hey there. Thanks for your work on giu! The readme mentioned automated Hidpi scaling. However, it seems that the UI looks quite a bit blurry on my M1 mac: 2022-10-26 - 18-13-38@2x

    I am running your 'getting started' example right from the Github page. Is there any setting that I need to adjust to get the text to be more sharp?

    Thanks :)

    Code example

    main.go
    // put your code here!
    

    To Reproduce

    1. Run my demo
    2. will see the crash...

    Version

    v0.6.1

    OS

    Mac

    bug 
    opened by vis2k 2
Releases(v0.6.2)
  • v0.6.2(Mar 22, 2022)

  • v0.6.1(Jan 27, 2022)

    Change log

    This is a bug fix release. Mainly fixed an issue under Windows when master windows is minimized, and the SplitLayout's state will lost after restore.

    Source code(tar.gz)
    Source code(zip)
  • v0.6.0(Dec 23, 2021)

    Change log

    1. Update Dear ImGUI to 1.85.
    2. Add Markdown Editor widget. Thanks @gucio321
    3. Add many comments. Huge thansk to @gucio321
    4. Tweak so many widgets.
    Source code(tar.gz)
    Source code(zip)
  • v0.5.6(Aug 5, 2021)

  • v0.5.5(Jul 28, 2021)

    Change log

    Breaking changes

    1. Implemented AutoID mechanism to avoid unnecessary id setting for lots of widgets.
    2. Rename GetAvaiableRegion to GetAvailableRegion.
    3. Add auto font detect with dynamic font glyph altas generator to display various languages without specifying fonts manually.

    New widgets

    1. Add ImageButtonWithRgba.
    Source code(tar.gz)
    Source code(zip)
  • v0.5.4(May 13, 2021)

    Change log

    Breaking changes

    1. Rename giu.Line to giu.Row.
    2. Rename giu.Group to giu.Column.

    Other changes

    1. Add Hint property to InputText.
    2. Add ColorEditWidget.
    3. Decouple imgui to another repo.
    4. Update imgui to 1.82.
    Source code(tar.gz)
    Source code(zip)
  • v0.5.3(Mar 17, 2021)

    Change log

    1. Update Dear ImGui to 1.82 Refer full change log of imgui https://github.com/ocornut/imgui/releases/tag/v1.82

    2. Update GLFW to v3.3

    Source code(tar.gz)
    Source code(zip)
  • v0.5.2(Jan 26, 2021)

  • v0.5.1(Jan 24, 2021)

    Change log

    1. Update imgui to 1.8.0.
    2. Refine TableWidget with new table api from imgui.
    3. Partially integrate ImPlot.

    Bug fixes

    1. Use sync.Map to store context.state to avoid crash issue when access state from go routine.
    Source code(tar.gz)
    Source code(zip)
  • v0.5.0(Jan 1, 2021)

    Breaking changes

    1. Widget creation now use method chain to set various properties. For example: Old style widget creation
    giu.InputTextMultiline("Text area", &content, 300, 100, 0, nil)
    giu.Button("Click Me", func() { fmt.Println("Clicked") })
    

    New style widget creation

    giu.InputTextMultiline("Text area", &content).Size(300, 100)
    giu.Button("Click Me").OnClick(func() {...})
    

    All xxxV methods are removed.

    With method chain, giu becomes more flexible to add properties and events to any widget in future.

    1. Rename MasterWindow.Main(...) to MasterWindow.Run(...).
    Source code(tar.gz)
    Source code(zip)
  • v0.4.2(Nov 6, 2020)

  • 0.4.1(Aug 1, 2020)

  • v0.4(Mar 27, 2020)

    Rename the tag of a release according to reasonable versioning.

    Change log

    1. Msgbox now has only two parameters. And provides Msgboxv for more control.
    2. Fix issue that Msgbox cannot be open from menu.
    3. Expose SetClipboard and GetClipboard from Platform.
    4. Add DatePicker.
    5. Wrap ColorfulTextEditor with minimal functions.
    Source code(tar.gz)
    Source code(zip)
Owner
Allen Dang
Allen Dang
Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies

Dear ImGui (This library is available under a free and permissive license, but needs financial support to sustain its continued improvements. In addit

omar 43.6k Dec 1, 2022
Cross-Platform GUI Framework for Go

⚠️ I'm currently working on this project as part of my master's thesis at the Berlin University of Applied Sciences and Technology. It is under active

Jannis Rieger 3 Oct 31, 2022
Cross platform GUI in Go based on Material Design

About Fyne is an easy to use UI toolkit and app API written in Go. It is designed to build applications that run on desktop and mobile devices with a

Fyne.io 18.8k Nov 22, 2022
Cross-platform Go/Golang GUI library.

中文 | English GoVCL Cross-platform Golang GUI library, The core binding is liblcl, a common cross-platform GUI library created by Lazarus. GoVCL is a n

不在乎y 1.7k Nov 30, 2022
Build cross platform GUI apps with GO and HTML/JS/CSS (powered by Electron)

Thanks to go-astilectron build cross platform GUI apps with GO and HTML/JS/CSS. It is the official GO bindings of astilectron and is powered by Electr

Quentin Renard 4.6k Nov 29, 2022
Build cross platform GUI apps with GO and HTML/JS/CSS (powered by nwjs)

gowd Build cross platform GUI apps with GO and HTML/JS/CSS (powered by nwjs) How to use this library: Download and install nwjs Install this library g

Danny 385 Nov 16, 2022
RobotGo, Go Native cross-platform GUI automation @vcaesar

Robotgo Golang Desktop Automation. Control the mouse, keyboard, bitmap, read the screen, Window Handle and global event listener. RobotGo supports Mac

vgo 8k Nov 22, 2022
Cross-platform GUI for go is never this easy and clean.

gimu Strongly suggest NOT to use this project anymore, the auto-generated cgo wrapper of Nuklear has a random crash issue which is hard to fix (becaus

Allen Dang 66 Jul 12, 2022
Kita is a declarative, reactive GUI toolkit for build cross platform apps with web technology with single codebase

Kita is a declarative, reactive GUI toolkit for build cross platform apps with web technology with single codebase. Inspired by Flutter, React. S

zhuah 106 Apr 18, 2022
UIKit - A declarative, reactive GUI toolkit for build cross platform apps with web technology with single codebase

UIKit - A declarative, reactive GUI toolkit for build cross platform apps with web technology with single codebase

zhuah 106 Apr 18, 2022
Platform-native GUI library for Go.

ui: platform-native GUI library for Go This is a library that aims to provide simple GUI software development in Go. It is based on my libui, a simple

Pietro Gagliardi 8.2k Nov 28, 2022
Windows GUI framework for Go.

gform is an easy to use Windows GUI toolkit for Go It provides two approaches to create UI. 1. Pure code. gform.Init() mainWindow := gform.NewForm(ni

Allen Dang 277 Nov 12, 2022
Tiny cross-platform webview library for C/C++/Golang. Uses WebKit (Gtk/Cocoa) and Edge (Windows)

webview A tiny cross-platform webview library for C/C++/Golang to build modern cross-platform GUIs. Also, there are Rust bindings, Python bindings, Ni

webview 10.7k Nov 23, 2022
Tiny cross-platform webview library for C/C++/Golang. Uses WebKit (Gtk/Cocoa) and Edge (Windows)

webview A tiny cross-platform webview library for C/C++/Golang to build modern cross-platform GUIs. Also, there are Rust bindings, Python bindings, Ni

webview 10.7k Dec 1, 2022
An experimental Go cross platform UI library.

GXUI - A Go cross platform UI library. Notice: Unfortunately due to a shortage of hours in a day, GXUI is no longer maintained. If you're looking for

Google 4.5k Nov 10, 2022
Build cross-platform modern desktop apps in Go + HTML5

Lorca A very small library to build modern HTML5 desktop apps in Go. It uses Chrome browser as a UI layer. Unlike Electron it doesn't bundle Chrome in

Serge Zaitsev 7.5k Nov 24, 2022
Cross-platform Go library to place an icon in the host operating system's taskbar.

trayhost Package trayhost is a cross-platform Go library to place an icon in the host operating system's taskbar. Platform Support macOS - Fully imple

null 235 Nov 6, 2022
Go cross-platform library for displaying dialogs and input boxes

dlgs dlgs is a cross-platform library for displaying dialogs and input boxes. Installation go get -u github.com/gen2brain/dlgs Documentation Document

Milan Nikolic 367 Nov 9, 2022
A cross-platform app-development module for Go.

The cross-platform Go module for building apps (pronounced klo-va-seed). Usecases As a lightweight alternative to Electron Write your frontend and nat

Qlova Limited 101 Dec 1, 2022