Debug window does not reopen - design or flaw?

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
kpeters58
Enthusiast
Enthusiast
Posts: 341
Joined: Tue Nov 22, 2011 5:11 pm
Location: Kelowna, BC, Canada

Debug window does not reopen - design or flaw?

Post 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
PB 5.73 on Windows 10 & OS X High Sierra
User avatar
Vera
Addict
Addict
Posts: 858
Joined: Tue Aug 11, 2009 1:56 pm
Location: Essen (Germany)

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

Post 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
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

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

Post by freak »

You can explicitly force the debug window to re-open from within the code with the ShowDebugOutput() command if you want to.
quidquid Latine dictum sit altum videtur
User avatar
kpeters58
Enthusiast
Enthusiast
Posts: 341
Joined: Tue Nov 22, 2011 5:11 pm
Location: Kelowna, BC, Canada

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

Post 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
PB 5.73 on Windows 10 & OS X High Sierra
Little John
Addict
Addict
Posts: 4779
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

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

Post 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.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

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

Post by Trond »

It would really be annoying if the window opened automatically.
Post Reply