[Threads] how to use threads with it?
import 
  os,
  nimx/window,
  nimx/text_field

var wnd = newWindow(newRect(40, 40, 800, 600))
let label = newLabel(newRect(20, 20, 150, 20))
wnd.addSubview(label)

proc mywhile() =
  var i = 0
  while(true):
    label.text = $i
    i = i + 1
    os.sleep(1000)

var th1: Thread[void]

createThread(th1, mywhile)

th1.joinThread()

proc main() = 
  echo "just run, don't bother"

runApplication:
  main()

-_-