Like Greg wrote: Check Apples docs: https://developer.apple.com/reference/appkit/nswindow/1419541-setcontentborderthickness?language=objc
It says
[quote]- (void)setContentBorderThickness:(CGFloat)thickness
forEdge:(NSRectEdge)edge;[/quote] (in ObjC language)
The minus at the start meaning its an instance methode, thats why you need to pass the window handle.
In Xojo Window.Handle is an Integer (4 Bytes on a 32 Bit system, 8 Bytes on a 64 Bit sytem) which maps exactly to what a “normal” Integer does. So no need to use (U)Int32 or (U)Int64.
While window.handle is an Integer, Apple uses Ptrs for the handle. Which behave exactly like Integer and can be interchanged with them - they take 4 Bytes on a 32 Bit system and 8 Bytes on a 64 Bit system too.
To make the declare compatible, you either have to declare the instance as an Integer (and can then pass Window.handle), or you can take Apples scheme (which makes it easier to use your declares on iOS too in the cases where they are the same), but then you have to convert Window.handle to a Ptr which can be done with typecasting: Ptr(Window.handle).
In every case where it is not noted differently, enumerations in Apples system use Integer too. Thats why NSRectEdge should be a “normal” Integer too (not Int32 or Int64).
Try this (all Integers):
[code]Protected Sub SetRoundWindowTopBottom(w As window, topHeight As Integer, botHeight As Integer)
#If TargetMacOS Then
#If TargetCocoa // Do you really want to check for Carbon? I think its unnecessary today.
Const NSBackingStoreType = 2
Const NSMaxYEdge = 3
Const NSMinYEdge = 1
Const NSTexturedBackgroundWindowMask = 256
Const NSTitledWindowMask = 1
Const NSResizabkeWindowMask = 8
Const NSMiniaturizableWindowMask = 4
Const NSClosableWindowMask = 2
Const NSResizableWindowMask=8
w.Frame=9
Declare Sub setBackingType Lib "Cocoa" selector "setBackingType:" ( ObjID As Integer, bufferingType As Integer)
Declare Sub setStyleMask Lib "Cocoa" seleactor "setStyleMask:" (obj_id As Integer, mask As Integer)
Declare Function styleMask Lib "Cocoa.framework" selector "styleMask" (id As Integer) As Integer
Declare Sub SetAutorecalculatesContentBorder Lib "AppKit" Selector "setAutorecalculatesContentBorderThickness:forEdge:" (inWindow As Integer, inRecalculates As Boolean, inEdge As Integer)
Declare Sub SetContentBorderThickness Lib "AppKit" Selector "setContentBorderThickness:forEdge:" (inWindow As Integer, inBorderThickness As CGFloat, inEdge As Integer)
Declare Sub ContentBorderThickness Lib "AppKit" Selector "ContentBorderThicknessForEdge:" (inWindow As Integer, inBorderThickness As CGFloat, inEdge As Integer)
//Soft Declare Sub setMovableByWindowBackground Lib "Cocoa" selector "setMovableByWindowBackground:" (windowRef As Integer, yesNo As Boolean)
'
'
'
setBackingType w.Handle, NSBackingStoreType
setStyleMask w.Handle, styleMask(w.Handle) Or NSTexturedBackgroundWindowMask
SetAutorecalculatesContentBorder(w.handle,False,NSMinYEdge)
SetAutorecalculatesContentBorder(w.handle,False,NSMaxYEdge)
If topHeight>0 Then SetContentBorderThickness(w.handle,topHeight,NSMaxYEdge) '<----set the height top]
If botHeight>0 Then SetContentBorderThickness(w.handle,botHeight,NSMinYEdge) '<----set the height bottom
w.Frame=0
#EndIf
#EndIf
End Sub[/code]