The Application Class

Application is a class that holds the actual program. Application has methods that the framework calls when, for example the user presses down a key or the framework wants the screen to be repainted. In order for the Application to receive events, it has to be registered with the system. For this the system.run applet method is used. The class Application is meant to be derived.

Example: Component
main
  system.run applet new MyComponent

class MyComponent extends Component

Application class in Origo is similar to applet or midlet concept in Java programming language.

The system events for component are as follows.

Drawing to the screen can happen only in draw event. The Graphics object given in draw event contains drawing methods that can be used to draw on the screen. It is not possible to directly draw to screen from any other method than draw event, although drawing can be done to an offscreen bitmap in any method, and draw event can then draw that bitmap to screen when asked to. The method screen.repaint can be used to ask framework to redraw the screen. This is usually done after a key event, for example. The system calls these methods when processing the event log.

API Documentation: Class Application