Running GUI checks alongside regular code

BlitzMax Forums/BlitzMax Programming/Running GUI checks alongside regular code

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

A cut-down version...


Repeat

	WaitEvent()

	Select EventID()

'---------------------------------------------------------------------------------------------------- MENUS

	Case EVENT_MENUACTION
		Select EventData()

			Case 6		 load()

		End Select

'---------------------------------------------------------------------------------------------------- TOOLBAR

	Case EVENT_GADGETACTION

		If EventSource()=toolbar

			Select EventData()

				Case 0	Print "test"

			End Select

		EndIf

	End Select

'---------------------------------------------------------------------------------------------------- CODE LOOP

	SetGraphics CanvasGraphics(canvas)
	Cls

	control()
	update_map()

	Flip

	If KeyHit(KEY_ESCAPE)

	End

	EndIf


Until EventID () = EVENT_WINDOWCLOSE



control() is merely a series of KeyDown checks, and UpdateMap just draws a tilemap.