[futurebasic] why won't button click work for me

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : May 1999 : Group Archive : Group : All Groups

From: Vic Maslen Advanced Materials <maslen@...>
Date: Mon, 3 May 1999 17:54:15 +1000 (EST)
I am trying to show three introductory pictures and to  
allow the user to decide when to move from one to the next.
The first picture comes up nicely, but when I click on the 
button in Window #1, the button click does not seem to be
registered and acted upon.  I would much appreciate help
in pointing to my programming error.
Vic Maslen.

Below is the relevant part of my program

LOCAL FN chooseToContinue  
evnt% = DIALOG(0)  
id% = DIALOG(evnt%)  
LONG IF evnt% = _btnClick    
continue = _true  
END IF
END FN

LOCAL FN chooseViewTime  
continue = _false  
ON DIALOG FN chooseToContinue  
DO     
HANDLEEVENTS  
UNTIL continue = _true
END FN

LOCAL
DIM rect.8
LOCAL FN showIntro  
vRn% = SYSTEM(_aplVol)  
RFnum% = FN HOPENRESFILE(vRn%,0,"SimulIntro.rsrc",_fsRdPerm)'second param,dirID  
LONG IF RFnum% = -1    
title$ = "Intro Resource"    
msg$ = "Failed to open resource file"    
FN doWarn(5,title$,msg$,0)         'SUPPLYSUPPLYSUPPLYSUPPLY  
END IF  
FOR I% = 0 TO 2    
introH& = FN GETPICTURE(150 + I%)    
LONG IF introH&      
rect;8 = [introH&] + _picFrame      
CALL OFFSETRECT(rect,-rect.left%,-rect.top%)      
pictHt% = rect.bottom% - rect.top%      
pictWdth% = rect.right% - rect.left%            

REM  Open a window to accommodate picture plus button            

title$ = "Introduction - " + STR$(I% + 1)      
WINDOW #1,title$,(0,0) - (pictWdth%,pictHt% + 50),_docNoGrow_noGoAway      
COLOR _zRed      
BUTTON #1,_markedBtn,"Continue",(10,pictHt% + 20) - (100,pictHt% + 36),_shadow      
CALL DRAWPICTURE(introH&,rect)      
CALL RELEASERESOURCE(introH&)    
END IF    
FN chooseViewTime    
WINDOW CLOSE #1  
NEXT I%  
CALL CLOSERESFILE(RFnum%)
END FN

FN showIntro