If I drag a slider onto the main window of a new desktop app with Xojo2021r3.1, build on macOS10.15.7 and then run the app on macOS12.3 (Monterey) the top of the slider is cropped. This looks like Feedback 64101 which was fixed in Xojo2021r2. I’m surprised I’m not seeing something in Feedback for this issue on Monterey. Am I missing something or is there a work-around? Thanks
Just confirmed here on Big Sur / M1, you’re not missing anything it’s clipping here as well.
Thanks Tim. I’ve logged on Feedback 68041
In the mean time…
In the slider’s Open event you can put this code:
#if XojoVersion < 2021.03
Declare Sub sizeToFit Lib "AppKit" Selector "sizeToFit" ( obj as integer )
#else
Declare Sub sizeToFit Lib "AppKit" Selector "sizeToFit" ( obj as Ptr )
#EndIf
sizeToFit(me.Handle)
This code gives me a compile error on the sizeToFit(me.Handle) line:
Parameter “obj” expects Type Ptr, but this is of Type Integer
What version of Xojo are you using?
The latest Test build.
You opened maybe a project created in a previous IDE version than 2021r3. Change obj As Ptr
to obj As Integer
and it should work.
Thank you all
I also got this compile error. This was because the slider super was “Slider” rather than “DesktopSlider”. This code works for me when the super is set to “DesktopSlider”
The code needs to be able to determine which class is calling this declare, or what datatype me.handle is.