Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use Go to make a GUI window?

Tags:

window

go

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?

like image 449
Mister Verleg Avatar asked Sep 30 '16 06:09

Mister Verleg


People also ask

Can you make a GUI with 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.

How do I create a Windows GUI?

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.

Does Go have GUI library?

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.

Can go be used for desktop apps?

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.


2 Answers

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

like image 100
shivendra pratap singh Avatar answered Sep 21 '22 15:09

shivendra pratap singh


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.

like image 35
zserge Avatar answered Sep 21 '22 15:09

zserge