ETHZ_Logo RAMSES_Logo_Right    RAMSES    RAMSES_Logo_Left Systems Ecology   

Example: AlmostSimple

Screen Dump


Source Code


MODULE AlmostSimple;  (*A.Fischlin, 26/Jun/86*)

  (*************************************************************
  
     This program module demonstrates how to install a menu
     and a command before starting the "Dialog Machine" and
     the mechanism to provide an application specific action,
     here the display of the waiting symbol during a delay.
     Furthermore the program demonstrates how to produce
     by means of a so-called alert a message telling the 
     user that the application specific action has been 
     terminated.
     
  *************************************************************)
     
  FROM DMAlerts IMPORT ShowAlert, WriteMessage;
  
  FROM DMMenus IMPORT Menu, InstallMenu, Command, InstallCommand, 
    AccessStatus, Marking; 
    
  FROM DMMaster IMPORT RunDialogMachine, 
    ShowWaitSymbol, Wait, HideWaitSymbol;


  VAR
    myMenu: Menu;
      aCommand: Command;
    

  PROCEDURE HiImFinished;
  BEGIN
    WriteMessage(2,4,"Hello!  I'm finished.");
  END HiImFinished;
    

  PROCEDURE TheBigAction;
    VAR i: INTEGER;
  BEGIN
    FOR i:= 1 TO 10 DO 
      ShowWaitSymbol; 
      Wait(60) (* ca. 1 second *); 
    END;
    HideWaitSymbol; ShowAlert(3,35,HiImFinished);
  END TheBigAction;
  
  
  PROCEDURE InitDM;
  BEGIN
    InstallMenu(myMenu,"Do something",enabled);
    InstallCommand(myMenu,aCommand,"boring...",TheBigAction, enabled,unchecked);
  END InitDM;
  
  
BEGIN
  InitDM;
  RunDialogMachine;
END AlmostSimple.

  RAMSES@env.ethz.ch Last modified 1/12/22 [Top of page]   

Modula-2 website ring
List all    |    <<  Prev    |    Next  >>    |    Join