I am in need to make a simple window in Go to display some text, there is no need for a real GUI like interface.
How can I make a window like this using Go?
A GUI can be created with a go package. There is no native support. There are several packages for making go gui's. The most common are web-based and desktop-based.
Click File > New, then select Dialog System Screenset on the New dialog box, and click OK. Click Yes on the message asking if you want to create a project. Select Windows GUI Project. Enter Welcome as the name of the project.
Cross-platform Golang GUI library, The core binding is liblcl, a common cross-platform GUI library created by Lazarus. GoVCL is a native GUI library, not based on HTML, let alone DirectUI library, everything is practical.
We can build a desktop app with Go in any common Javascript framework using Wails. Wails has the ability to wrap Go Code and web frontend into a single binary.
walk is the most common library used for basic GUI development.
You can import the package using:
go get github.com/lxn/walk
I assume you are working at windows OS so create an exe and run it.
More Information about this can be gathered from its source.
Visit https://github.com/lxn/walk
A nice-looking cross-platform UI can be created using HTML5/CSS/JS. You may open a native window with a full-screen browser engine (webview) in it showing your UI.
There is a tiny wrapper library for webviews on Windows, MacOS and Linux - https://github.com/zserge/webview
You can connectyour UI and the core app parts using Go-to-JS bindings (webview library provides those) or a websocket.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With