Page 1 of 1

ResizeWindow don't work with Debugger

Posted: Fri Oct 03, 2025 3:49 pm
by Sergey
Hi,
I took a standard source from topic "Window" and insert CallDebugger after OpenWindow command and commented two lines with MessageRequester
After run with debugger program stoped on CallDebugger line, I press Continue, but now Window don't change X and Y coordinates, only sizes
If I commented CallDebugger line the window changes X and Y coordinates. It's not normal!

If uncommented Requesters lines the window also moves to new X and Y coordinates

Source: C:\Program Files\PureBasic\Examples\Sources\Window.pb
PureBasic 6.30 beta 2 (x64) on Windows 10 x64

Just try with CallDebugger and without it in debugger mode...

Code: Select all

If OpenWindow(0, 100, 200, 195, 260, "PureBasic Window", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget)
	
	CallDebugger
	
;   MessageRequester("Information", "Click to move the Window", 0)
  ResizeWindow(0, 200, 200, #PB_Ignore, #PB_Ignore)   ; Move the window to the coordinate 200,200
  
;   MessageRequester("Information", "Click to resize the Window", 0)
  ResizeWindow(0, #PB_Ignore, #PB_Ignore, 320, 200) ; Resize the window to 320,200
  
  ;
  ; This is the 'event loop'. All the user actions are processed here.
  ; It's very easy to understand: when an action occurs, the Event
  ; isn't 0 and we just have to see what have happened...
  ;

  Repeat
    Event = WaitWindowEvent()

    If Event = #PB_Event_CloseWindow  ; If the user has pressed on the close button
      Quit = 1
    EndIf

  Until Quit = 1
  
EndIf

End   ; All the opened windows are closed automatically by PureBasic

Re: ResizeWindow don't work with Debugger

Posted: Fri Oct 03, 2025 4:22 pm
by infratec
Hm ...

with the same constellation, I get the missbehaviour only if I bring the window to foreground.
If I simply continue the program after the stop, the window moves.

Re: ResizeWindow don't work with Debugger

Posted: Fri Oct 03, 2025 4:34 pm
by Sergey
infratec, foreground don't help me,
the window always freezes with stop on CallDebugger and Continue :|

I think this an old problem :wink:
What version of PB you tested?

And If you Insert Debug WindowX(0) the PB will lie :lol:

Code: Select all

	Debug WindowX(0)
 	CallDebugger
	Debug WindowX(0)
	
;   MessageRequester("Information", "Click to move the Window", 0)
  ResizeWindow(0, 200, 200, #PB_Ignore, #PB_Ignore)   ; Move the window to the coordinate 200,200
  Debug WindowX(0)
;   MessageRequester("Information", "Click to resize the Window", 0)
  ResizeWindow(0, #PB_Ignore, #PB_Ignore, 320, 200) ; Resize the window to 320,200
  Debug WindowX(0)
[19:39:45] [Debug] 100
[19:39:45] [Debug] 100
[19:39:45] [Debug] 200
[19:39:45] [Debug] 200

Coordinates change, but window don't moves :shock:

Re: ResizeWindow don't work with Debugger

Posted: Sat Oct 04, 2025 12:11 am
by Sergey
No one except infratec answered
freak will say I need coffee ... more coffee today :)