Windows GUI library for Go (Golang). Comes with a graphical UI designer.

Version 2

Please go to Version 2 of this library for the latest version.

Windows GUI Library

This is a pure Go library to create native Windows GUIs.

The godoc.org documentation is broken for some reason and the pkg.go.dev documentation has issues with the license for some versions, I am not sure what the problems are. Until I find a way to generate nice HTML documentation inside this repo itself and can link to that, just run

go doc -all github.com/gonutz/wui

to see the documentation as text. You can add a > doc.txt to save it to a file, or a | clip to copy it to the clipboard and paste it into your editor. The godoc command will also display it for you, in nice HTML, but it takes a while to start.

Minimal Example

This is all the code you need to create a window (which does not do much).

package main

import "github.com/gonutz/wui"

func main() {
	wui.NewWindow().Show()
}

The Designer

I am currently working on a graphical designer. It is located under cmd/designer.

At the moment it lets you place widgets graphically and generate a Go main file from it (using the Save menu). You can also run a preview with Ctrl+R.

There is no way to read the generated code back in at the moment. Right now it is a tool to place things and generate code from it.

Comments
  • StringTable

    StringTable

    I used var AStringTable = wui.NewStringTable("NO", "ANALYZER NAME", "DRIVER") to create StringTable, and got this: unnamed

    How do I create a StringTable properly? Why do I get 4 columns instead of 3 and how do I set full names to columns? Also i dunno how to add rows to this, will be glad to get any help

  • why this module doesn't display docs on pkg.go.dev

    why this module doesn't display docs on pkg.go.dev

    This is a response to the feedback filed today on pkg.go.dev.

    We look for semver tags on the repo and use those to decide which version to display by default. For this repo, v2.0.0 is the latest tag, and https://github.com/gonutz/wui/tree/v2.0.0 does not contain a license file. Nor does v1.0.0.

    If you tag master and "go get" it with that tag via the proxy, it should work.

  • How to draw image after some event

    How to draw image after some event

    Hi again :), How to draw image on paintBox after other event, for example OnButtonClick? I wrote code like below, but it is not working. In below code I want to draw png image on PaintBox after clicking "Show Image" button.

  • How do I bind a key to NewEditLine object?

    How do I bind a key to NewEditLine object?

    Hello I'm a newbie who found out this gui library today. I have the following example of my code:

    func main() {
    	x := 70
    	y := 70
    	width := 180
    	height := 60
    
    	window := wui.NewWindow()
    	window.SetSize(500, 500)
    	entry := wui.NewEditLine()
    	entry.SetSize(width, height)
    	entry.SetPosition(x, y)
    	entry.SetText("this is an entry")
    	window.Add(entry)
    	window.Show()
    }
    

    I am trying to make a program that when I am 'focused' (like when my text cursor is flashing at the entry) on the entry object, and I press return key, it deletes the entered text, then executes a function. I tried using SetOnKeyDown and OnKeyDown function but they both don't accept an int variable so I can't figure out how to use it. Thanks

    p.s. This is just my opinion, but I think it would be very helpful for newbies if you can add a bit more code to 'Minimal Example' section in README. Like few basic examples of label, button and editLine like my example code.

  • Unable to build: w32.* undefined

    Unable to build: w32.* undefined

    using the same example found in the readme

    $ go build
    # github.com/gonutz/wui
    C:\Users\zachd\go\pkg\mod\github.com\gonutz\[email protected]+incompatible\menu.go:72:15: undefined: w32.MIIM_STATE
    C:\Users\zachd\go\pkg\mod\github.com\gonutz\[email protected]+incompatible\menu.go:74:17: undefined: w32.MFS_CHECKED
    C:\Users\zachd\go\pkg\mod\github.com\gonutz\[email protected]+incompatible\menu.go:76:17: undefined: w32.MFS_UNCHECKED
    C:\Users\zachd\go\pkg\mod\github.com\gonutz\[email protected]+incompatible\menu.go:90:15: undefined: w32.MIIM_STRING
    C:\Users\zachd\go\pkg\mod\github.com\gonutz\[email protected]+incompatible\paintbox.go:312:25: undefined: w32.AC_SRC_ALPHA
    
  • LinkLabel

    LinkLabel

    Hey, how do i create a LinkLabel like this?:

    LinkLabel

    I tried adding .SetText("<a href=\"https://google.com\">google.com</a>") for the TextLabel, but it didn't work.

  • Got panic err when run design tool

    Got panic err when run design tool

    platfrom: win10 x64

    Failed to find SetClassLongPtrW procedure in user32.dll: The specified procedure could not be found

    goroutine 1 [running, locked to thread]: syscall.(*LazyProc).mustFind(...) C:/go/src/syscall/dll_windows.go:320 syscall.(*LazyProc).Call(0x11460120, 0x115088e0, 0x3, 0x3, 0x0, 0x0, 0x201, 0x13) C:/go/src/syscall/dll_windows.go:336 +0x89 github.com/gonutz/w32/v2.SetClassLongPtr(...) D:/Projects/git/qxb_cus/pkg/mod/github.com/gonutz/w32/[email protected]/functions.go:790 github.com/gonutz/wui.(*Window).SetCursor(0x1144c2c0, 0x11412138) C:/Projects/wui/window.go:520 +0x8c main.main.func27(0x3da, 0x333) C:/Projects/wui/cmd/designer/designer.go:1117 +0x543 github.com/gonutz/wui.(*Window).onMsg(0x1144c2c0, 0x5548e, 0x200, 0x0, 0x33303da, 0x14) C:/Projects/wui/window.go:738 +0x1f0 syscall.Syscall(0x75d956c0, 0x1, 0x1150a1e0, 0x0, 0x0, 0x0, 0x0, 0x0) C:/go/src/runtime/syscall_windows.go:188 +0xbb syscall.(*Proc).Call(0x11405530, 0x1150886c, 0x1, 0x1, 0x4, 0xecf2a0, 0xf35001, 0x1150886c) C:/go/src/syscall/dll_windows.go:180 +0x108 syscall.(*LazyProc).Call(0x1143bf80, 0x1150886c, 0x1, 0x1, 0x0, 0x1145b7d4, 0xf35070, 0x1013880) C:/go/src/syscall/dll_windows.go:337 +0x54 github.com/gonutz/w32/v2.DispatchMessage(...) D:/Projects/git/qxb_cus/pkg/mod/github.com/gonutz/w32/[email protected]/functions.go:676 github.com/gonutz/wui.(*Window).Show(0x1144c2c0, 0x0, 0x0) C:/Projects/wui/window.go:959 +0x5c4 main.main() C:/Projects/wui/cmd/designer/designer.go:1306 +0x454c

  • How to draw an image?

    How to draw an image?

    I have noticed some code related to it on the paintbox code, but haven't figured out how to draw an image to it, if isn't too much trouble, could you give me a hint? Thanks!

  • How to run designer

    How to run designer

    Hey, can`t run designer by using "go run designer.go", getting error like "...\designer.go:2037:13: undefined: generateProperties, how do I do that? Sorry for bothering

  • Printing

    Printing

    This is a really useful library.

    I am trying to work out how to access the printer spool on windows. Could not find anything in the W32 lib.

    The firm's I just screenshot using the golang lib called robot-vg.

    If you know how to access the windows print spooler I can help with some aspects ??

  • How to open new window by pressing a button?

    How to open new window by pressing a button?

    Hey, sorry for another dumb question, but how do I show new window by pressing a button? I have main window and button that added to it, what should I do to open a new window by pressing to button? Main window is supposed to be inactive at this moment.

  • Change the folder browser to include a text box for pasting a folder

    Change the folder browser to include a text box for pasting a folder

    The folder browser is very unhelpful as it is currently. This is a quick fix to make it better.

    If there is a way to replace it with the regular file dialog (just for folders) that would be way better.

  • TextEdit styling questions

    TextEdit styling questions

    I've got 2 questions about styling TextEdit widget:

    1. Is it possible to change the background color of TextEdit?
    2. Is it possible to add syntax highlighting to the content of TextEdit?
  • Memory leak in wui.Image

    Memory leak in wui.Image

    i think that there is a memory leak when creating images

    to my current understanding: w32.CreateDIBSection is called to allocate memory when the image is deleted by GC, this memory is not freed (a call to w32.DeleteObject is missing)

    can anyone confirm?

  • Cannot interact with parent window after creating child window

    Cannot interact with parent window after creating child window

    As the title said, it is not possible to interact with parent window while child window is showing.

    (Part of my code. There are many other widgets on parent window)

    win := wui.NewWindow()
    win.SetFont(winFont)
    win.SetTitle("Window")
    
    ...
    
    openLogBtn := wui.NewButton()
    openLogBtn.SetBounds(15, 91, 85, 25)
    openLogBtn.SetText("View Logs")
    openLogBtn.SetEnabled(false)
    openLogBtn.SetOnClick(func() {
          viewer := wui.NewWindow()
          viewer.SetFont(winFont)
          viewer.SetTitle("Log Viewer")
          viewer.SetHeight(800)
          viewer.SetWidth(600)
          
          textedit := wui.NewTextEdit()
          textedit.SetAnchors(wui.AnchorMinAndMax, wui.AnchorMinAndMax)
          textedit.SetBounds(0, 0, 600, 800)
          textedit.SetText("...")
          viewer.Add(textedit)
          
          viewer.ShowModal()
    })
    win.Add(openLogBtn)
    
    win.Show()
    

    Is it possible to interact with two windows at the same time?

  • Error after triggering by pressing button modal window on secont time

    Error after triggering by pressing button modal window on secont time

    Hi, I have main window in my application and modal window, which are trigered by pressing button. I use ShowModal() method to show modal window and Close() method to close this window. It is working fine for first time I use, but when I hit button second time or more to show modal window it returning error -"window already visible". It seems I am doing something wrong Closing this window, but I really have no idea what exactly. Could you help me (again :) )

Common library for Go GUI apps on Windows
Common library for Go GUI apps on Windows

winc Common library for Go GUI apps on Windows. It is for Windows OS only. This makes library smaller than some other UI libraries for Go.

Dec 12, 2022
A Windows GUI toolkit for the Go Programming Language
A Windows GUI toolkit for the Go Programming Language

About Walk Walk is a "Windows Application Library Kit" for the Go Programming Language. Its primarily useful for Desktop GUI development, but there is

Dec 30, 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

Jan 1, 2023
Windows API and GUI in idiomatic Go.
Windows API and GUI in idiomatic Go.

Windigo Win32 API and GUI in idiomatic Go. Overview The UI library is divided in the following packages: Package Description ui High-level UI wrappers

Dec 27, 2022
Native Go (golang) Graphical Interface system (2D and 3D), built on GoKi tree framework
Native Go (golang) Graphical Interface system (2D and 3D), built on GoKi tree framework

GoGi is part of the GoKi Go language (golang) full strength tree structure system (ki = 木 = tree in Japanese) package gi is a scenegraph-based 2D and

Dec 25, 2022
Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies
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

Dec 31, 2022
A unified graphical user experience toolkit for Go desktop applications

Unison A unified graphical user experience toolkit for Go desktop applications. macOS, Windows, and Linux are supported. Required setup Unison is buil

Dec 20, 2022
An example desktop system tray application that can launch HTML5 windows. Go source with a build process for Windows, Mac and Linux.

ExampleTrayGUI An example cross-platform (Mac, Windows, Linux) system tray application that can launch HTML5 windows, developed in Go including functi

Dec 3, 2022
An example desktop system tray application that can launch HTML5 windows. Go source with a build process for Windows, Mac and Linux.

ExampleTrayGUI An example cross-platform (Mac, Windows, Linux) system tray application that can launch HTML5 windows, developed in Go including functi

Dec 3, 2022
An example desktop system tray application that can launch HTML5 windows. Go source with a build process for Windows, Mac and Linux.

An example cross-platform (Mac, Windows, Linux) system tray application that can launch HTML5 windows, developed in Go including functional build process. This repository is intended as a quick reference to help others start similar projects using the referenced libraries and will not be actively maintained.

Dec 3, 2022
An example desktop system tray application that can launch HTML5 windows. Go source with a build process for Windows, Mac and Linux.

ExampleTrayGUI An example cross-platform (Mac, Windows, Linux) system tray application that can launch HTML5 windows, developed in Go including functi

Dec 3, 2022
W32find - Find parent windows and their children windows using win32api.

w32find Package w32find provides a set of interface to win32 APIs that can be used to find windows and their controls. Install go get -v github.com/mo

Jan 5, 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

Dec 30, 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

Jan 9, 2023
This project provides Go bindings for nuklear.h — a small ANSI C GUI library.
This project provides Go bindings for nuklear.h — a small ANSI C GUI library.

Nuklear Package nk provides Go bindings for nuklear.h — a small ANSI C gui library. See github.com/vurtun/nuklear. All the binding code has automatica

Jan 1, 2023
Cross platform rapid GUI framework for golang based on Dear ImGui.
Cross platform rapid GUI framework for golang based on Dear ImGui.

giu Cross platform rapid GUI framework for golang based on Dear ImGui and the great golang binding imgui-go. Any contribution (features, widgets, tuto

Dec 28, 2022
Idiomatic Golang GUI using Lorca
Idiomatic Golang GUI using Lorca

Dali Summary Dali is a pure Golang library built on lorca in order to provide Go developers a way to create GUI-based applications using idiomatic Go.

Jul 11, 2022
Neovim GUI written in Golang
Neovim GUI written in Golang

Neovim GUI written in Golang, using a Golang qt backend (https://github.com/ther

Dec 29, 2021
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

Dec 28, 2022