nimx

Cross-platform GUI framework


Keywords
gui, ui, library, nim
License
MIT
Install
nimble install nimx

Documentation

nimx travis nimble

Cross-platform GUI framework in Nim.

Live demo in WebGL

./doc/sample-screenshot.png

Quick start

Installation

nimble install nimx

Please note that nimx is tested only against the latest devel version of Nim compiler.

Usage

# File: main.nim
import nimx.window
import nimx.text_field

# First create a window. Window is the root of view hierarchy.
var wnd = newWindow(newRect(40, 40, 800, 600))

# Create a static text field and add it to view hierarchy
let label = newLabel(newRect(20, 20, 150, 20))
label.text = "Hello, world!"
wnd.addSubview(label)

# Run the main loop
runUntilQuit()

Running

Unix:

nim c -r --noMain --threads:on main.nim

Windows:

nim c -r --threads:on main.nim

Running nimx samples

cd $(nimble path nimx)/test
nake # Build and run on the current platform
# or
nake js # Build and run in default web browser

Reference

TODO