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

Share your advanced knowledge/code with the community.
User avatar
Peter
Posts: 888
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

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

Post 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
hoerbie
Posts: 34
Joined: Sun Mar 17, 2019 5:51 pm

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

Post by hoerbie »

Exactly the right tip at the right time, THANKS!
User avatar
Charlie
Posts: 46
Joined: Thu Jan 10, 2019 1:54 am
Location: New Brunswick, Canada

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

Post by Charlie »

Awesome tip! Thanks !
Huge fan of SpiderBasic, and very passionate about these other personal projects:
User avatar
Kurzer
Posts: 85
Joined: Mon May 26, 2014 9:33 am

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

Post 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. ;)
SB 2.32 x86, Browser: Iron Portable V. 88.0.4500.0 (Chromium based), User age: 53y
"Happiness is a pet." | "Never run a changing system!"
Post Reply