Page 1 of 1

Quick-Tipp: Determine the window number of the debug window

Posted: Sun Nov 10, 2019 4:02 pm
by Peter
Hello,

with this little code snippet you are able to determine the window number of the debug window:

Code: Select all

Define SpiderDebugWindow
! v_spiderdebugwindow = spider.debug.window;
With this windows number, you can control the debug window with the native window commands:

Code: Select all

; change the window-title
SetWindowTitle(SpiderDebugWindow, "Debug-Output")

; change the position of the debug-window (bottom/right instead of top/right):
ResizeWindow(SpiderDebugWindow, #PB_Ignore, DesktopHeight(0) - WindowHeight(SpiderDebugWindow, #PB_Window_FrameCoordinate), #PB_Ignore, #PB_Ignore)

; etc...
Greetings ... Peter

Re: Quick-Tipp: Determine the window number of the debug win

Posted: Sun Nov 10, 2019 6:00 pm
by hoerbie
Exactly the right tip at the right time, THANKS!

Re: Quick-Tipp: Determine the window number of the debug win

Posted: Tue Nov 12, 2019 12:15 am
by Charlie
Awesome tip! Thanks !

Re: Quick-Tipp: Determine the window number of the debug win

Posted: Tue Aug 04, 2020 2:05 pm
by Kurzer
Thank you for this tip, Peter. Image
I was just looking for something like this.

I wanted to use your code to resize the debug window, but unfortunately you have to enlarge the window manually every time, because the editor gadget in the debug windows is not resized.

I have now created the following code to resize the debugwindow.

Code: Select all

! spider_ResizeWindow(spider.debug.window, 10, 10, 1024, 800)
! spider_ResizeGadget(spider.debug.editorGadget, 5, 5, spider_WindowWidth(spider.debug.window) - 10, spider_WindowHeight(spider.debug.window) - 10)
Or set it to fullscreen:

Code: Select all

! spider_ResizeWindow(spider.debug.window, 0, 0, spider_DesktopWidth(0), spider_DesktopHeight(0))
! spider_ResizeGadget(spider.debug.editorGadget, 5, 5, spider_WindowWidth(spider.debug.window) - 10, spider_WindowHeight(spider.debug.window) - 10)
If the big debug windows covers your own windows, make it unsticky:

Code: Select all

! spider_StickyWindow(spider.debug.window, 0)
Markus

PS: Peeking into the libs/debug.js was a big help. ;)