As expected, the debug window pops up and displays the corresponding message. Any subsequent clicks yield more messages.
Now close the debug window and click again - the debug window does not reopen, even though the code explicitly demands it.
Cannot be a bug because a bug of this magnitude wouldn't live that long - so it must be by design.
I would argue that this design goes against the expectations of the vast majority of coders - the principle of least surprise exists for a good reason.
I wish there'd be either a warning dialog upon closing of the debug window or a popup menu offering something like 'Disable debug window for remainder of program run'.
Or (always a possibility) am I missing the boat completely?
Code: Select all
Global Window_0, Button_0, Button_1
Procedure OpenMainWindow(x = 0, y = 0, width = 230, height = 190)
Window_0 = OpenWindow(#PB_Any, x, y, width, height, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
Button_0 = ButtonGadget(#PB_Any, 55, 70, 110, 30, "Open window 1")
Button_1 = ButtonGadget(#PB_Any, 55, 110, 110, 30, "Open window 2")
EndProcedure
OpenMainWindow()
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_Gadget
Select EventGadget()
Case Button_0: Debug "Button 1 clicked!"
Case Button_1: Debug "Button 2 clicked!"
EndSelect
EndSelect
Until Event = #PB_Event_CloseWindow