Can´t sliders be vertical unter macOS Sierra any more?
At Ieast it won´t work for me with Xojo 2013 R2 and Xojo 2016 R3

Apparently there’s only two of us that have noticed this problem. I found that it’s a Cocoa based issue because Carbon compiles work just fine like they always have.

I found that while the code does fix the slider issue with Sierra, it doesn’t work with prior OSx’s so you need a check to determine which version of OS X is running or the “setVertical(me.Handle,True)” will cause an exception.

I used MBS to do it:

Declare Sub setVertical Lib "Cocoa" Selector "setVertical:" (windowRef As Integer, id As Boolean) If SystemInformationMBS.MacMinorVersion = 12 Then// we are Sierra setVertical(me.Handle, True) End If

I just confirmed that it does raise an exception in 10.11.6
but works as advertised with 10.12

This should be something that Xojo can build into the underlying Slider class, since it already knows that it should be vertical based on the width vs height

FYI… Sam posted this a while back, and I just tested it on 10.11.6 and 10.12.0 and it works

no MBS required

and if you use this code, or what Mel posted above… you might want to check >=12 to futureproof your code… because I doubt Sierra is the last macOS ever to be released :slight_smile:

I agree Dave, Sierra probably won’t be the last OS released. I did consider making the code “future proof” but my experience is that every time I have done that, its come back to bite me. So I don’t assume or anticipate any more and just handle it as it comes.

The only reason I use MBS is for the MIDI and PortAudio classes so it was nice to see an alternative as well. I’m assuming that the posted works from 10.6 and newer? Or?

Interestingly enough, if you use a Carbon build the vertical sliders work just fine in both 10.11 and 10.12. It’s only the Cocoa builds in 10.12 that need the bandaid. More of an OS oversight than a XOJO issue?

as far as oversight… I don’t think so… it worked in Carbon once upon a time, and Apple deprecated Carbon years ago. So while it may still be “in” Sierra, it has most likely NOT been changed much, hence it still “works” (for now).

So it is not that Sierra needs a “band-aid”, in so much as this is the new direction for macOS, and Xojo hasn’t caught up yet.

In Apples own software (ie. Swift/Objc) they support directly only a horizontal slider… and it requires a AFineTransform(sic) to rotate it… But I am going to take this post as an opportunity to see if the above solution can be applied to iOS as well

At any rate, you should file a bug report if you want to have any hope of that issue to be resolved.

I was surprised when the Carbon build worked in spite of the fact it was deprecated years ago. Seems to be some lingering code base in there, like I never done that myself in my own code…LOL

Never thought of Sierra as a direction, more of a distraction to me since I have yet to anything in it that I’d ever actually use. But then again, I’m old school and not the target market so it doesn’t matter in any event. I have a few apps to support and that’s all I need of it.

I did report the bug via Feedback, and maybe it’ll be resolved, maybe it won’t. I don’t expect much, thus, rarely ever get disappointed…:slight_smile:

There is a note in the online docs now, well, at least a partial one that says to use the Declare for Sierra, but it fails to mention you have to check for the version or you get an exception.

What I’ve always admired is the community surrounding Xojo that jumps in to lend a hand in a timely fashion. It’s the single reason I still use Xojo. Thanks all!

This problem just bit me now.

Thanks for the solution !!

Tony Barry