why would a gouped window close the app

BlitzMax Forums/BlitzMax GUI Programming/why would a gouped window close the app

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.

And if you want to actually suspend main window-related execution you'll need to structure your primary loop appropriately. Example:

SuperStrict

Local window:TGadget = CreateWindow("Main Window",50, 50, 240, 240)
Local button:TGadget = CreateButton("Click Me", 5, 5, 100, 50, window)
Local label:TGadget = CreateLabel("0", 5, 60, 100, 50, window)

Local modal:TGadget = CreateWindow("Modal Window",50, 50, 200, 200, window, WINDOW_TITLEBAR | WINDOW_HIDDEN)

Local timer:TTimer = CreateTimer(1)
Local oldtime:Int = 0
Local value:Int = 0

Local DoMainWindowStuff:Int = True

Repeat

	PollEvent	

	Select EventID()
		Case EVENT_WINDOWCLOSE
			If EventSource() = window Then End
			If EventSource() = modal
				EnableGadget button
				EnableGadget window
				DoMainWindowStuff = True
				HideGadget modal
			EndIf	
		Case EVENT_GADGETACTION
			DoMainWindowStuff = False
			DisableGadget button
			DisableGadget window
			ShowGadget modal
	End Select

	If DoMainWindowStuff
		Local t:Int = TimerTicks(timer)
		If t > oldtime
			oldtime = t
			value :+ 1
			If value > 1000 Then value = 0
			SetGadgetText(label, value)
		EndIf
	EndIf
	
Forever