///////////////////////////////////////////////////////////////////////////////
//                             Lisaac Example                                //
//                                                                           //
//                   LSIIT - ULP - CNRS - INRIA - FRANCE                     //
//                                                                           //
//   This program is free software: you can redistribute it and/or modify    //
//   it under the terms of the GNU General Public License as published by    //
//   the Free Software Foundation, either version 3 of the License, or       //
//   (at your option) any later version.                                     //
//                                                                           //
//   This program is distributed in the hope that it will be useful,         //
//   but WITHOUT ANY WARRANTY; without even the implied warranty of          //
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           //
//   GNU General Public License for more details.                            //
//                                                                           //
//   You should have received a copy of the GNU General Public License       //
//   along with this program.  If not, see <http://www.gnu.org/licenses/>.   //
//                                                                           //
//                     http://isaacproject.u-strasbg.fr/                     //
///////////////////////////////////////////////////////////////////////////////
Section Header
  
  + name      := MONITOR;

  - copyright := "2003-2008 Sonntag Benoit";

  - author    := "Sonntag Benoit (sonntag@icps.u-strasbg.fr)";
  - comment   := "The main prototype";
  
Section Private
  
  - box:G_OUT;
  
  - win:AREA;
  
Section Public
  
  - is_open:BOOLEAN <- (win != NULL) && {win.parent != NULL};
  
  - append str:ABSTRACT_STRING <-
  (    
    (box != NULL).if {      
      box.text.append str;
      {box.text.occurrences '\n' > 20}.while_do { 
        box.text.remove_first (box.text.first_index_of '\n');
      };
      win.refresh;
    };
  );
    
  - init:G_EXPR <-
  ( 
    G_RAW.create (box := G_OUT.create "Scan information system...\n\n\n\n\n")
  );
  
  - run:G_WIN_OUT <-
  ( 
    win := G_WIN_OUT.create "Monitor" with init
  );
  
  - main <-
  (     
    // Init window.
    VIDEO.make_size (400,400);
    DESK.make VIDEO with (
      (win := G_OUT.create "Monitor" justify (G_OUT.center).fix_height) / init
    );        
  );
  
