Window containing vertical Slider won't open on macOS 10.10.5 or 10.11.1 when built with Xojo2021r2.1

I reported this [https://xojo.com/issue/66120](https://xojo.com/issue/66120) last night. Aside from rolling back to Xojo2021r1.1, can anyone offer a work-around to get a vertical Slider working with apps built with Xojo2021r2.1?

Thanks,

Mark

Make your own slider with a canvas.

Firstly, the window not showing is normal behavior since macOS 10.14. You need to enabled “NSApplicationCrashOnExceptions” to figure out why!

I took a look at your case and code. If I may make a suggestion with your declares.

#if TargetMacOS then
  #if xojoversion < 2021.2 then
    declare sub NSSlider_setVertical lib "AppKit" selector "setVertical:" ( NSSliderInstance as integer, value as boolean ) // --- OS X 10.0 +
    NSSlider_setVertical( me.handle, true )
  #endif
#endif

This way the declare documents itself. So when / if Apple decide to change this in the future, especially when all Mac apps move over to UIKit, you have references here to look up the original documentation or header files and hopefully figure out what it is that you need to replace it with.

I’ve tried it with and without the declare and it crashes. Enabling the NSApplicationCrashOnExceptions, reveals that it is crashing with the error that “[XOJSlider setVertical:] is unrecognized.” According to Apple’s Docs it has been since 10.0 +

Setting the slider so it is 100 x 23 in the IDE and then flipping the dimensions in code appears to work.

I’ve dug into the Xojo Runtime on 10.10 and sure enough the setVertical: function is not exposed, but it is on macOS Big Sur. I don’t know if this is an Apple thing or a Xojo thing.

Many thanks @Sam_Rowlands for this information. I haven’t used declares much. This slider is part of an extension that I purchased from a developer that no longer responds to emails :slight_smile: Nice work-around.

It’s also good to see that @Greg_O_Lone fixed or has had this bug fixed overnight. Many thanks Greg.

1 Like