Skip to content

Examples ​

All of these are in examples/.

ExampleShows
hello.carguments, stdout, the time
parent.c, child.cos9_fork, os9_wait, exit status
signal.cos9_intercept, os9_send, waking os9_sleep
link.cos9_link to a module, its header
stress.cthe runtime under load
ui-hello.cthe smallest NavX UI app: a counter with a focus ring, inside the shell
c
/* ui-hello.c, the loop */
for (;;) {
  int e = ui_app_wait(5);
  if (e < 0) continue;
  if (e == UI_HOME) ui_app_exit(0);
  if (e == UI_PREV && foc > 0) foc--;
  if (e == UI_NEXT && foc < 2) foc++;
  if (e == UI_SELECT) {
    if (foc == 0) ui_app_exit(0); /* back at the top: done */
    n += foc == 2 ? 1 : -1;
  }
  draw();
}

The bigger apps are ibusx (the I-Bus monitor) and the NavX shell itself. Both are closed source and built on the same library.

ibusx in the shell

The NavX SDK is private for now; these docs are public.