Bug ? CloseWindow() ends the program

Just starting out? Need help? Post your questions and find answers here.
Mesa
Enthusiast
Enthusiast
Posts: 345
Joined: Fri Feb 24, 2012 10:19 am

Bug ? CloseWindow() ends the program

Post by Mesa »

See the code under please.

Is that a bug ?

M.

Code: Select all

If OpenWindow(0, 0, 0, 400, 260, "Exemple...", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
	
	EditorGadget	(0, 10, 10, 380, 200)
	ButtonGadget (1, 10, 220, 380, 30, "Close")
	
	AddGadgetItem(0, -1, "If you clic on the button 'Close' then the program ends and the debugger doesn't appear") 
	AddGadgetItem(0, -1, "If you clic on the button '[x]' on the top of the windows then the debugger appears and the program ends")
	Repeat
		Event = WaitWindowEvent()
		
		Select Event
				
			Case #PB_Event_Gadget
				Select EventGadget()
					Case 1 
						CloseWindow(0)
						End  
				EndSelect
				
		EndSelect
	Until Event = #PB_Event_CloseWindow
EndIf

Debug "end"

// No Bug. Moved from "Bugs - Windows" to "Coding Questions" (Kiffi)
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: Bug ? CloseWindow() ends the program

Post by Marc56us »

Code: Select all

                Select EventGadget()
                    Case 1 
                        CloseWindow(0)
                        Break ; End  
                EndSelect
Last edited by Marc56us on Wed Feb 08, 2023 11:07 am, edited 1 time in total.
BarryG
Addict
Addict
Posts: 3293
Joined: Thu Apr 18, 2019 8:17 am

Re: Bug ? CloseWindow() ends the program

Post by BarryG »

Mesa wrote: Wed Feb 08, 2023 10:40 amIs that a bug ?
For future reference: if you have to ask that, it's probably not a bug. Post in Coding Questions instead.
Post Reply