#18 move to event-driven main loop
[fanfix.git] / src / jexer / TWidget.java
index 08c0a45ca9c68c28c8345b14faa5f1344d852daf..d292ec1490c938f304e142a565551d8eb6060e74 100644 (file)
@@ -550,6 +550,13 @@ public abstract class TWidget implements Comparable<TWidget> {
         }
     }
 
+    /**
+     * Repaint the screen on the next update.
+     */
+    public void doRepaint() {
+        window.getApplication().doRepaint();
+    }
+
     // ------------------------------------------------------------------------
     // Constructors -----------------------------------------------------------
     // ------------------------------------------------------------------------
@@ -990,7 +997,8 @@ public abstract class TWidget implements Comparable<TWidget> {
 
     /**
      * Method that subclasses can override to do processing when the UI is
-     * idle.
+     * idle.  Note that repainting is NOT assumed.  To get a refresh after
+     * onIdle, call doRepaint().
      */
     public void onIdle() {
         // Default: do nothing, pass to children instead