Package nk provides Go bindings for nuklear.h — a small ANSI C gui library. See github.com/vurtun/nuklear.
All the binding code has automatically been generated with rules defined in nk.yml.
An idiomatic wrapper package isn't coming I guess, because it will require strong interest in further development and I have no time for that now. The nk package is fine for the start, then we'll figure out something better that just a wrapper.
nuklear alternatives and similar packages
Based on the "GUI" category.
Alternatively, view nuklear alternatives based on common mentions on social networks and blogs.
fyne9.8 9.8 nuklear VS fyneCross platform GUI toolkit in Go inspired by Material Design
Wails9.7 9.8 nuklear VS WailsCreate beautiful applications using Go
webview9.6 8.2 nuklear VS webviewTiny cross-platform webview library for C/C++/Golang. Uses WebKit (Gtk/Cocoa) and Edge (Windows)
ui9.6 0.0 nuklear VS uiPlatform-native GUI library for Go.
robotgo9.5 4.9 L3 nuklear VS robotgoRobotGo, Go Native cross-platform GUI automation @vcaesar
Lorca9.4 0.0 nuklear VS LorcaBuild cross-platform modern desktop apps in Go + HTML5
app9.4 6.0 nuklear VS appA package to build progressive web apps with Go programming language and WebAssembly.
walk9.4 0.0 nuklear VS walkA Windows GUI toolkit for the Go Programming Language
go-astilectron9.1 3.1 nuklear VS go-astilectronBuild cross platform GUI apps with GO and HTML/JS/CSS (powered by Electron)
gallium8.9 0.0 nuklear VS galliumBuild desktop applications in Go and HTML.
systray8.6 1.0 nuklear VS systraya cross platfrom Go library to place an icon and menu in the notification area
sciter8.6 1.6 nuklear VS sciterSciter: the Embeddable HTML/CSS/JS engine for modern UI development
go-gtk8.4 0.0 nuklear VS go-gtkGo binding for GTK
go-qml8.4 0.0 nuklear VS go-qmlQML support for the Go language
gotk38.3 5.5 nuklear VS gotk3Go bindings for GTK3
goqt8.1 0.0 nuklear VS goqtGolang bindings to the Qt cross-platform application framework.
Guark6.8 5.0 nuklear VS GuarkBuild awesome Golang desktop apps and beautiful interfaces with Vue.js, React.js, Framework 7, and more...
gosx-notifier6.8 0.0 nuklear VS gosx-notifiergosx-notifier is a Go framework for sending desktop notifications to OSX 10.8 or higher
go-thrust6.5 0.0 nuklear VS go-thrustCross Platform UI Kit powered by Blink/V8/Chromium Content Lib
one-file-pdf6.3 0.0 nuklear VS one-file-pdfA minimalist Go PDF writer in 1982 lines. Draws text, images and shapes. Helps understand the PDF format. Used in production for reports.
gowd6.3 0.0 nuklear VS gowdBuild cross platform GUI apps with GO and HTML/JS/CSS (powered by nwjs)
zenity6.2 8.5 nuklear VS zenityZenity dialogs for Golang, Windows, macOS
Gowut6.0 0.0 nuklear VS GowutGo Web UI Toolkit - Public Releases and Development
trayhost5.4 0.0 L5 nuklear VS trayhostCross-platform Go library to place an icon in the host operating system's taskbar.
NanoGUI5.2 0.0 nuklear VS NanoGUIA golang port of NanoGUI
mac-sleep-notifier2.4 0.0 nuklear VS mac-sleep-notifiermacOS Sleep/ Wake notifications in golang
mac-activity-tracker2.3 0.0 nuklear VS mac-activity-trackerA library to notify about any (pluggable) activity on your machine, and let you take action as needed
go-appindicator2.2 1.6 nuklear VS go-appindicator:traffic_light: Go bindings for libappindicator3 C library
Dali0.8 0.0 nuklear VS DaliIdiomatic Golang GUI using Lorca
goradd/html5tag0.6 1.0 nuklear VS goradd/html5taghtml5tag generates html 5 tags
AppIndicator Go0.2 3.8 nuklear VS AppIndicator Go:traffic_light: Go bindings for libappindicator3 C library
gioGio is a library for writing cross-platform immediate mode GUI-s in Go. Gio supports all the major platforms: Linux, macOS, Windows, Android, iOS, FreeBSD, OpenBSD and WebAssembly.
Clean code begins in your IDE with SonarLint
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of nuklear or a related project?
Package nk provides Go bindings for nuklear.h — a small ANSI C gui library. See github.com/vurtun/nuklear. All the binding code has automatically been generated with rules defined in nk.yml.
There is no idiomatic wrapper package that will make things easier to use, but the original API is pretty straightforward. The
nk package is fine for the start, then we'll figure out something better that just a wrapper.
Features (plain C version)
- Immediate mode graphical user interface toolkit
- Single header library
- Written in C89 (ANSI C)
- Small codebase (~15kLOC)
- Focus on portability, efficiency and simplicity
- No dependencies (not even the standard library if not wanted)
- Fully skinnable and customizable
- Low memory footprint with total memory control if needed or wanted
- UTF-8 support
- No global or hidden state
- Customizable library modules (you can compile and use only what you need)
- Optional font baker and vertex buffer output
This is a minimal state immediate mode graphical user interface single header toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window and input handling but instead provides a very modular library approach by using simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends it only focuses on the actual UI.
Your Go application runs a loop where it handles input from the platform and manages the rendering backend. It uses Nuklear API bindings (the
nk package) to run UI commands for layout and event handling. Nuklear maintains a draw command list that is consumed by one of the rendering backends so the UI is displayed. In this case, a C program is being a middleman that does all the UI heavylifting for us, so we can focus on the application logic, event handling and drawing backends in Go.
Installation of nk
Supported platforms are:
- Windows 32-bit
- Windows 64-bit
- OS X
The desktop support is achieved using GLFW and there are backends written in Go for OpenGL 2.1 and OpenGL 3.2. Thanks to strangebroadcasts it also has SDL2 support now.
Android support is added using the android-go project, there is a corresponding backend for OpenGL ES 2.0 or 3.0 surface and input handling logic. Sophisticated things like scroll gestures will be added later.
Debian/Ubuntu dependencies: (Header files required for GLFW)
# apt install xorg-dev
Fedora(tested on 28):
# libX11-devel libXcursor-devel libXrandr-devel libXinerama-devel mesa-libGL-devel libXi-devel
After that, standard
go get should work:
$ go get github.com/golang-ui/nuklear/nk
On desktop both OpenGL 2.1 and OpenGL 3.2 contexts are working fine, but by default OpenGL 3.2-core is used, to compile with OpenGL 2.1 support instead. The 2.1 backend is for legacy hardware or VMs like Parallels.
$ go get -tags opengl2 github.com/golang-ui/nuklear/nk
Additional steps for Windows users:
- Get MinGW compiler toolchain and MSYS via MinGW installer;
- Open MSYS shell (usually
Then everything should go smooth.
$ go version go version go1.6.2 windows/386 $ gcc -v COLLECT_GCC=C:\MinGW\bin\gcc.exe Thread model: posix gcc version 5.3.0 (GCC) $ go install github.com/golang-ui/nuklear/nk
-tags sdl2 to run with SDL2 instead of GLFW. SDL2 requires additional installation process, see SDL2. Use GLFW if you want to stay go-get-able.
In order run Android demo app nk-android make sure that you've prepared your environent as described in plain example Android app. Namely you need to install Android SDK, tools and run
$ cd $GOPATH/src/github.com/golang-ui/nuklear/cmd/nk-android $ make toolchain # need to run once # the regular routine: $ make $ make install $ make listen
There is an example app nk-example that shows the usage of Nuklear GUI library, based on the official demos.
$ go get github.com/golang-ui/nuklear/cmd/nk-example $ nk-example 2016/09/23 23:13:09 glfw: created window 400x500 2016/09/23 23:13:10 [INFO] button pressed! 2016/09/23 23:13:10 [INFO] button pressed! 2016/09/23 23:13:10 [INFO] button pressed!
Another more realistic Go application that uses Nuklear to do its GUI, a simple WebM player:
Rebuilding the package
You will need to get the c-for-go tool installed first.
$ git clone https://github.com/golang-ui/nuklear && cd nuklear $ make clean $ make
Building nuklear - Using vcpkg
You can download and install nuklear using the vcpkg dependency manager:
git clone https://github.com/Microsoft/vcpkg.git cd vcpkg ./bootstrap-vcpkg.sh ./vcpkg integrate install ./vcpkg install nuklear
The nuklear port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.
All the code except when stated otherwise is licensed under the MIT license. Nuklear (ANSI C version) is in public domain, authored from 2015-2016 by Micha Mettke.
*Note that all licence references and agreements mentioned in the nuklear README section above are relevant to that project's source code only.