Page 1 of 1

Debug window does not reopen - design or flaw?

Posted: Fri Sep 04, 2015 8:18 pm
by kpeters58
Run the simple program below and click any button.

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

Re: Debug window does not reopen - design or flaw?

Posted: Fri Sep 04, 2015 9:06 pm
by Vera
Hi,
If during one compile-session I deside that I don't need any further debug outputs I can close the output window and it won't 'annoy' me during this session with poping up while I'm focused on other subjects.

If I deside I need it again I can reopen it via menu: Debugger/Debug Output.

Or - simply start a new compile-session and it returns as wanted.

Please don't introduce a further popup-message like "Are you really sure you want to close this window?" :?

greets ~ Vera

Re: Debug window does not reopen - design or flaw?

Posted: Fri Sep 04, 2015 9:38 pm
by freak
You can explicitly force the debug window to re-open from within the code with the ShowDebugOutput() command if you want to.

Re: Debug window does not reopen - design or flaw?

Posted: Sat Sep 05, 2015 1:20 am
by kpeters58
Thanks for both your inputs.

So you both have learned how this works, as have I now.

My point is that there is a learning curve that doesn't have to be there. I am also not a friend of having a zillion dialogs for all kinds of things when my goal is being productive.

To this end at least two improvements come to mind:

a) Mention this behavior in the help (just re-read the entire debugger chapter to be sure it's not there) as it is unexpected

b) Possibly have a one-time dialog/dialog with "Don't show this again" option

Re: Debug window does not reopen - design or flaw?

Posted: Sat Sep 05, 2015 6:49 am
by Little John
The behaviour of the Debug window is exactly as I expect it.
When I close a window, I do not expect it to magically re-open later.
When I just want the Debug window to get temporarily out of the way, then I click its "minimize" button, not its "close" button.

Re: Debug window does not reopen - design or flaw?

Posted: Sat Sep 05, 2015 12:13 pm
by Trond
It would really be annoying if the window opened automatically.