Why and how can I change this behavior?
Code: Select all
#NSWindowStyleMaskTexturedBackground = 1 << 8
#NSWindowStyleMaskFullSizeContentView = 1 << 15
Global Window_0, Button_0
Procedure OpenWindow_0(x = 0, y = 0, width = 450, height = 160)
Window_0 = OpenWindow(#PB_Any, x, y, width, width, "", #PB_Window_ScreenCentered | #PB_Window_SystemMenu )
Button_0 = ButtonGadget(#PB_Any, 160, 50, 130, 25, "OK")
view = CocoaMessage(0, GadgetID(Button_0), "superview")
NSWindow = CocoaMessage(0, GadgetID(Button_0), "window")
mask = CocoaMessage(0, NSWindow, "styleMask")
mask | #NSWindowStyleMaskFullSizeContentView ;-< changes the button height too
CocoaMessage(0, NSWindow, "setStyleMask:@", @mask)
CocoaMessage(0, NSWindow, "setTitlebarAppearsTransparent:", #True)
CreateImage(0, width, 22)
ImageGadget(#PB_Any, 0, 0, width, 22, ImageID(0))
EndProcedure
Procedure Window_0_Events(event)
Select event
Case #PB_Event_CloseWindow
ProcedureReturn #False
Case #PB_Event_Menu
Select EventMenu()
Case #PB_Menu_Quit
ProcedureReturn #False
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
Case Button_0
EndSelect
EndSelect
ProcedureReturn #True
EndProcedure
OpenWindow_0()
Repeat
event = WaitWindowEvent()
Until Window_0_Events(event) = #False
End