Skip to content
/ ui Public
forked from nim-lang/ui

Beginnings of what might become Nim's official UI library.

License

Notifications You must be signed in to change notification settings

zhouhm/ui

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UI

This package wraps the libui C library.

In order to make use of it you will need to build the C library first. Instructions for doing so can be found here.

Using the wrapper

Start by installing this wrapper using Nimble:

nimble install ui

Then test that everything works by using this code sample:

import
  ui

proc main() =
  var mainwin = newWindow("libui Control Gallery", 640, 480, true)
  mainwin.margined = true
  mainwin.onClosing = (proc (): bool = return true)

  let box = newVerticalBox(true)
  mainwin.setChild(box)

  var group = newGroup("Basic Controls", true)
  box.add(group, false)

  var inner = newVerticalBox(true)
  group.child = inner

  inner.add newButton("Button", proc() = msgBox(mainwin, "Info", "button clicked!"))

  show(mainwin)
  mainLoop()

init()
main()

About

Beginnings of what might become Nim's official UI library.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Nim 68.3%
  • C 31.7%