setAutoresizingMask got other result in 32 and 64 bit app

I want to use vibrancy in my window background and found the code below. It workes great when I compile it in a 32bit app, but if I do 64bit the NSRect is outside the window (bottom left) Does setAutoresizingMask works different in 64bit mode?
I can see the rect when I resize the window to the bottom left. It’s there but position and the resizing anchors are not correct.

test.xojo_binary_project

Window.Open:

[code]#if targetmacos
declare function NSClassFromString lib CocoaLib (className as CFStringRef) as ptr
declare function alloc lib CocoaLib selector “alloc” (classRef as ptr) as ptr
dim EffectViewClass as Ptr = NSClassFromString (“NSVisualEffectView”)
if EffectViewClass <> NIL then // we have at least OS X 10.10
declare function initWithFrame lib CocoaLib selector “initWithFrame:” (id as ptr, frame as NSRect) as ptr
declare sub addSubViewRelativeTo lib CocoaLib selector “addSubview:positioned:relativeTo:” (id as ptr, view as ptr, position as integer, relativeTo as Ptr)
declare sub setAutoresizingMask lib CocoaLib selector “setAutoresizingMask:” (view as ptr, mask as integer)

dim frameRect as NSRect
frameRect.x = 0
frameRect.y = 0
frameRect.w = self.Width
frameRect.h = self.Height
dim WindowEffectView as new NSVisualEffectView(frameRect)
WindowEffectView.material = NSVisualEffectView.NSVisualEffectMaterial.NSVisualEffectMaterialLight //NSVisualEffectMaterialDark
setAutoresizingMask(WindowEffectView, 18)

Declare function contentView lib CocoaLib selector “contentView” (mwindow as integer) as ptr
dim contentViewPtr as ptr = contentView(self.Handle)
dim NSWindowBelow as Integer = -1
addSubViewRelativeTo(contentViewPtr, WindowEffectView, NSWindowBelow, nil)
end if
#endif[/code]

could it be related to the INTEGER calls? where they would have changed from a 32bit Int to a 64bit Int?

If I understand the help right, Xojo will automatically use the right Integer. So, I think the 18 at line

setAutoresizingMask(WindowEffectView, 18) will still be an 18 XD
Or what exsactly do you mean?

EDIT: I still couldn’t figure out what are the values for the second parameters of setAutoresizingMask. I can find the constants available but not their values :confused:
(https://developer.apple.com/documentation/appkit/nsview/autoresizingmask)

my point was, Xojo changed it to 64bit, but the Declares still want a 32bit

Doesn’t seen to have any effect if I change the data types to 32bit.

test.xojo_binary_project

[quote=431891:@Ratchet Lombax]EDIT: I still couldn’t figure out what are the values for the second parameters of setAutoresizingMask. I can find the constants available but not their values :confused:
[/quote]
On the page you linked, click an item in the constants section.

Try using uinteger for the mask parameter.

Be sure your definition of NSRect uses CGFloats not Singles.

I just found it out in another threat :smiley: But thank you so much. Works great now.

[quote=338349:@Eli Ott]As far as I know one should use CGFloat instead of Single for NSRect to be able to compile for both 32Bit and 64Bit:

Structure NSRect x As CGFloat y As CGFloat width As CGFloat height As CGFloat End[/quote]