WinBlitz3d Events Help

Blitz3D Forums/Blitz3D Programming/WinBlitz3d Events Help

Kev - System spec as follows:
AMD Athlon 2600+(1.92Ghz) 1Gig DDR, WinXP Home SP2
Nvidia 6200 256mb.
I also thought it must be something else causing the problem until I tried it in the test code.
The code is exactly the same as the last simplified example with the WB3D_GenerateEvents added :
Include "WB3DStyles.bb"

; setup gfx mode.
Graphics3D 640,480,16,2
Global switch=0

; install winblitz3d.
 RuntimeWindow_hWnd = WB3D_InitializeGUI(SystemProperty("AppHwnd"),10,10,300,200)
WB3D_SetQuitMessage "WinBlitz3D 3D/GUI","Sure To Quit" 
WB3D_HideGadget RuntimeWindow_hWnd

; create winapi window, setting its title, and position on screen. use default style creation.
 example_window = WB3D_CreateWindow("WB3D_CreateWindow Example",200,100,450,275,0,0)
 trackbar = WB3D_CreateTrackBar%(10, 24, 200, 30,example_window,0,TBS_AUTOTICKS Or TBS_TOP Or WS_CHILD)
WB3D_SetTrackBarRange (trackbar,0,100)
WB3D_SetTrackBarPos (trackbar,0)
 button=WB3D_CreateButton%("Start",10, 60, 60, 20,example_window,0)

thislabel = WB3D_CreateEditField("",10,100,30,20,example_window,0,0)
 spinner = WB3D_CreateSpinner(40, 100,50,20,example_window,0,0)
WB3D_SetSpinnerRange (spinner,0,100)
WB3D_SetSpinnerPos (spinner,0)
; cleanup any old creation events, its better to do this before we enter the main
; event loop, when some gadgets are created they generate events.
WB3D_FlushEvents 

; setup out quit flag, and loop until the flag is set.
QUIT = 0
While Not QUIT = 1
	
	; generate an internal blitz event
	Flip
	Cls
	Text 10,10,selected
	; get an event of the event queue.
	event = WB3D_WaitEvent()
	Select event
		
		
		Case WB3D_EVENT_GADGET
			selected = WB3D_EventSource()
			
			Select selected
				Case button
					switch=Not switch
					If switch 
						WB3D_SetGadgetText(button,"Stop")
					Else
						WB3D_SetGadgetText(button,"Start")
					End If

				Case trackbar
					 WB3D_SetSpinnerPos(spinner,WB3D_GetTrackBarPos(trackbar))
				Case spinner
					 WB3D_SetTrackBarPos(trackbar,WB3D_GetSpinnerPos(spinner))
				
				
				
			
			End Select


		Case WB3D_EVENT_KEYPRESS
		
			; wb_eventdata holds the key code that was pressed.
			keypressed = WB3D_EventData()
			Select keypressed
				
				Case WB3D_KEY_ESCAPE	
					
					; set the flag to leave the loop.
					QUIT = 1
					
			End Select
				
		Case WB3D_EVENT_WINDOW_CLOSE
		
			; wb3d_eventsource hold the handle to the window that close button was selected
			window = WB3D_EventSource()
			Select window
			
				Case example_window
					
					; set the flag to leave the loop.
					QUIT = 1
					
			End Select
	End Select

	If switch
		count=count+1
			If count>100 count=0
			WB3D_GenerateEvents 0
				WB3D_SetTrackBarPos (trackbar,count)
				WB3D_SetSpinnerPos (spinner,count)
			WB3D_GenerateEvents 1
			End If	
Wend

; use notify using external winapi constants. 
WB3D_Notify "WB3D GUI Window Example","Bye, Thats It I Quit",MB_OK Or MB_ICONASTERISK
WB3D_EndGUI()
EndGraphics

If this works for you then perhaps the problem is system related ?!?
I have tries the start/stop events - I will try again using both commands to see if that helps.
Thanks once again for your help with this = a temp command to see the number of events in the queue would be very helpful - might give some idea of what is happening.