This is driving me potty

BlitzMax Forums/BlitzMax GUI Programming/This is driving me potty

Please, please can someone put my mind at rest and tell me why neither the cancelbutton or the escape key exits my
loop. >:O

here is the chunk of the loop in question. There is a large delay while the images load, but i dont understand why its not buffering the keyhit/button click
		SetGadgetText(pblabel,"Loading Colormap......")
		proc=proc+1;UpdateProgBar(pbar,Float(proc)/Float(processes))
		inmapcolor:TPixmap=LoadPixmap(colorfile$)

		SetGadgetText(pblabel,"Loading Alphamap......")
		proc=proc+1;UpdateProgBar(pbar,Float(proc)/Float(processes))
		inmapalpha:TPixmap=LoadPixmap(alphafile$)
		
		Select WaitEvent()
			Case EVENT_GADGETACTION						' interacted with gadget
			  	Local esrc:Object=EventSource()
			  	Select esrc
			  		Case cancelit
			  		   Exit
			  	End Select

		  	Case EVENT_KEYUP
		  		Select EventData()
					Case KEY_ESCAPE
						Exit
				End Select
			
			Case EVENT_WINDOWCLOSE						' close gadget
				Exit			
		End Select