[futurebasic] Re: Building window invisibly

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 1997 : Group Archive : Group : All Groups

From: BMichael <BMichael@...>
Date: Wed, 24 Dec 1997 00:24:03 EST
>Thanks, Scott. "HANDLEEVENTS" works in the simple demo, but not in the
>actual application code below. The splashScreen still doesn't work,
>although the "About..." screen under the apple menu now does build in the
>background.
>
>I'm still doing something wrong, but I am making progress.

You're still not calling HANDLEEVENTS after building the window!

Your main;

>WINDOW OFF
>COORDINATE WINDOW
>FN splashScreen
>DELAY 4000
>WINDOW CLOSE #1

Note no HANDLEEVENTS call, thus no window refreshing.

>ON DIALOG FN doDialog
>ON MENU FN doMenu
>ON MOUSE FN doMouse
>
>FN buildWnd
>
>DO
>  HANDLEEVENTS
>UNTIL gProgramEnds

Now here, you _do_ call HANDLEEVENTS after building the window. If you 
add a HANDLEEVENTS after FN splashScreen and before the close (preferably 
like this;

FOR i% = 1 TO 1000
  HANDLEEVENTS
  DELAY 4
NEXT i%

instead of the DELAY 4000) it should work. However... having more than 
one HANDLEEVENTS in a program can get quite hairy; you'll probably want 
to do something more like this;

WINDOW OFF
COORDINATE WINDOW

ON DIALOG FN doDialog
ON MENU FN doMenu
ON MOUSE FN doMouse

gPass% = 1

DO
  HANDLEEVENTS
  LONG IF gPass%
    SELECT gPass%
      CASE 1
        FN splashScreen
      CASE 1001
        WINDOW CLOSE #1
        FN buildWnd
        gPass% = 0
      CASE ELSE
        DELAY 4
        INC(gPass%)
     END SELECT
  END IF
UNTIL gProgramEnds

Bill