Listing 1

// main is called by Liana to start the application
main
{
  // Create and show a window.
  (w = new window) .show;
}

// paint is called by Liana to update window.
// Note that it queries the current window
// size to calculate the graphic coordinates.

paint
{
  // Some text.
  w << "Hello World";

  // Diagonal line from upper left to lower right.
  w.line (0, 0, w.width, w.height);

  // Circle in middle of screen.
  int x = w.width / 2;
  int y = w.height / 2;
  int r = min (w.width, w.height) / 4;
  w.circle (x, y, r);

  // Rectangle around the circle.
  w.rectangle (x - r - 30, y - r - 10,
             x + r + 30, y + r + 10);
}
// End of File