Slider Width

Using SuperCard and the Runtime Editor... working with windows, backgrounds, cards and menus.

Slider Width

Postby DougDenby » Wed Nov 01, 2017 4:45 pm

Just discovered what appears to be an interesting item: The width of a slider button is wider than it says it is.

I have an object with a slider bar lined up next to it on the right. If the object moves, in a handler, I move the slider by first setting the location of the slider to the location of the object, then setting the left of the slider to the right of the object. As the slider is in front of the object, the right edge of the object is obscured. I fixed the problem by converting the slider to a scrollbar and the problem disappears. Interesting!

Haven't checked the other edges.

Doug Denby
Posts: 56
Joined: Mon Jul 07, 2008 3:28 am

Re: Slider Width

Postby codegreen » Mon Nov 06, 2017 11:50 am

The effect you're describing is caused by the fact that in OS X controls basically regard their nominal bounds more or less the way most drivers interpret those yellow speed signs you see when approaching curves (i.e., as more of a helpful suggestion than a limit).

Thankfully many of the worst offenders (like the old pulsing default btn with its giant shadow) have grown more modest with age, but it's doubtful we'll ever see the day when standard controls are all content to draw entirely within their declared bounds.

Alas there's really no way (save for a chronically-obsolete internal table of exceptions) to fiddle their nominal bounds on the fly to compensate for this, because runtime visual bounds can't be determined programmatically (and they're different from OS to OS). Also some widely-used controls draw weird when not deployed at their HIG-specified 'optimal' sizes.

If you're laying out a new UI by hand most times it all works out in the end, but when opening legacy projects things can sometimes get pretty crowded.

But FWIW in practice if you encounter overlap basically it means Apple thinks you're putting things too close together...

Posts: 1533
Joined: Mon Jul 14, 2008 11:03 pm

Return to SuperCard Basics

Who is online

Users browsing this forum: No registered users and 1 guest