Space before window title

Just starting out? Need help? Post your questions and find answers here.
itzybitzyspider
Posts: 27
Joined: Tue Nov 22, 2022 4:36 am

Space before window title

Post by itzybitzyspider »

Hi guys, simple question here.

https://pasteboard.co/uGMs61mSXSA6.png

how do you set that space before the title of a window? Is this a global icon or can I set it per window?
User avatar
Peter
Posts: 1086
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: Space before window title

Post by Peter »

Quick'nDirty:

Code: Select all

EnableExplicit

Procedure SetWindowTitleIcon(Window, Icon.s)
  
  If IsWindow(Window) = #False : ProcedureReturn : EndIf
  
  Protected WID = WindowID(Window)
  
  ! var win = v_wid.window;
  ! var wintitle = $(win).find(".spiderwindow-title");
  ! wintitle.parent().prepend("<div style='position: absolute; top: 2px; left: 2px; height: 22px; width: 22px; line-height: 22px; text-align: center;'>" + v_icon + "</div>");
  
EndProcedure

OpenWindow(0, #PB_Ignore, #PB_Ignore, 600, 400, "WindowIconTest1", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
SetWindowTitleIcon(0, "😀")

OpenWindow(1, #PB_Ignore, #PB_Ignore, 300, 200, "WindowIconTest2", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
SetWindowTitleIcon(1, "😎")
Image
itzybitzyspider
Posts: 27
Joined: Tue Nov 22, 2022 4:36 am

Re: Space before window title

Post by itzybitzyspider »

@Peter, much obliged as always!
Post Reply