Skip to Main Content
Hands-On GUI Application Development in Go
book

Hands-On GUI Application Development in Go

by Andrew Williams
February 2019
Intermediate to advanced content levelIntermediate to advanced
450 pages
11h 59m
English
Packt Publishing
Content preview from Hands-On GUI Application Development in Go

Code

To get started with our first nk application, there's a certain amount of setup code we need to write. Nuklear is focused on delivering a graphical toolkit API and not the operating system-specific code such as managing windows and user input. To avoid having to write all of that code ourselves, we'll use the glfw Go bindings to create and show a window for our application. The following code will set up an application window and show it (without any content). We also need to call runtime.LockOSThread() as this setup code must all execute on the main thread:

package mainimport "runtime"import "github.com/go-gl/glfw/v3.2/glfw"import "github.com/go-gl/gl/v3.2-core/gl"func init() {   runtime.LockOSThread()}func main() {   glfw.Init()   win,  ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Building Cross-Platform GUI Applications with Fyne

Building Cross-Platform GUI Applications with Fyne

Andrew Williams

Publisher Resources

ISBN: 9781789138412Supplemental Content