/* Tbird Application Class (seal-off startup code) */!!

inherit(Application, #TbirdApp, nil, 2, nil)!!

now(class(TbirdApp))!!

now(TbirdApp)!!

/* This method returns true (self) to indicate that the sender 
   may continue the abort process. */
Def abort(self)
{ }
!!

/* close the App */
Def close(self)
{ 
  if mainWindow cand close( mainWindow ) 
  then
    TheProjectPresenter cand close(TheProjectPresenter) ;
    close( self:ancestor ) ;
  endif;
}!!

/* intiialize our application: the BETA Application */
Def init(self, aString)
{
  init( self:ancestor, aString ) ;
  Call SetMessageQueue( 200 ) ;
  mainWindow := newMain( Window, nil, "Dummy", nil ) ;
  mainWindow := main( PrjDefWindow ) ;
  startupScript( TheProjectPresenter ) ; /* "StartUp.scr" */
}!!

/* Take care of business before terminating the application. */
Def shouldClose(self)
{
  if TheProjectPresenter
  then
    ^shouldClose( TheProjectPresenter )
  else
    ^#true  /* no other reason for existence */
  endif ;
/**
  do(OpenWindows:late,
  {using(win)
    bringToTop(win);
    if not(shouldClose(win))
    then ^nil
    endif;
  }); **/
}!!
