public void pass(Event ev, List<Event> out) {
      if (ev instanceof ResizeEvent) {
         resize();
         return;
      }
      if (ev instanceof UpdateEvent) {
         if (pending_resize)
            pending_resize();
         update();
         return;
      }
      if (ev instanceof KeyEvent) {
         keyevent((KeyEvent) ev);
         return;
      }
      if (ev instanceof IdleEvent) {
         if (pending_resize)
            pending_resize();
         idle();
         for (Page page : pages)
            page.idle();
         return;
      }
   }