You can actually make the window completely transparent and then draw it yourself in Window.Paint. This only works for the content region, the titlebar still gets drawn, so you’ll need to make the window frame as Plain Box. It also looks like there’s no drop shadow in that picture which can be turned off, and I added dragging by background since there’s no titlebar.
[code]//Make the Window Plain Box and add these events to it
const Cocoa = “Cocoa”
declare sub setOpaque lib Cocoa selector “setOpaque:” (id As integer, b As boolean)
declare function NSClassFromString lib Cocoa (aClassName as CFStringRef) as Ptr
declare function clearColor lib Cocoa selector “clearColor” (NSColorClass As Ptr) As Ptr
declare sub setBackgroundColor lib Cocoa selector “setBackgroundColor:” (NSWindow As integer, backgroundColor As Ptr)
//allow for transparency by setting opaqueness false
//set the background completely transparent
//don’t add shadow
declare sub hasShadow lib Cocoa selector “setHasShadow:” (id As integer, b As Boolean)
//allow dragging by background
declare sub setMovable lib Cocoa selector “setMovableByWindowBackground:” (id As integer, b As Boolean)
Sub Paint(g As Graphics, areas() As REALbasic.Rect)
//Whatever you draw here constitutes the background, including transparencies.
//black transparent base
g.ForeColor = &c00000099
g.FillRoundRect(0, 0, g.Width, g.Height, 50, 50)
//solid white stuff
g.ForeColor = &cFFFFFF
g.FillOval( 50, 50, 50, 50 )
g.PenWidth = 10
g.PenHeight = 10
g.DrawOval( 10, 10, 130, 130 )
With this the window is draggable even from areas not drawn over. I’m not sure why but setting the ‘style’ to 0 (which is a titleless window, what I thought Plain Box did) allows clicks to fall through, as if your window really isn’t there. Actually the click though happens when the alpha is F3 or above.
Add these lines to Open and try different black fill colors, &c000000F2 is draggable but &c000000F3 isn’t, yet the white opaque part still is.
//somehow allows very mostly transparent areas to not be clickable
declare sub setStyle lib cocoa selector "setStyleMask:" (id As integer, mask As UInt32)