Why does pushbutton on Mac get less wide if I make it 23 pixel high

Why does pushbutton on Mac get less wide if I make it 23 pixel high ?

As soon as putting it to 23 pixels in high in the designer then button gets less wide. 22, 21 and 20 don’t do this.

That’s just a friendly reminder to not make it 23 pixels high.

The standard Mac pushButton, when set as default, turns downright gremlin. It jumps and steers like a mustang. You cannot count on it to react fairly to change in size. For RubberViews, I had to devise an entire equivalence table between set size and result.

Strangely, the non-default button is a much more stable beast : it simply won’t change height unless you set its style to bevel.

Cocoa only supports specific control sizes and using other sizes can result in strange drawing.

As Joe says, the native control doesn’t allow you to change the height - in Xcode you can only select, from memory, 15, 18 and 21 as the height.

You can change the height of a BevelButton - although it can often look pretty ugly in my opinion.

My purpose of it was mostly to make it bigger for Linux button.

Maybe it should jut stop growing at 22 (or 21) and not switch to bevel mode ? It would probably make it easier to design for all platforms.

I did not notice any such bizarre behavior under Linux or Windows. Only on Mac. So if your concern is linux, you can probably safely increase height only for Linux, and leave Mac buttons alone at their nominal 22px.

yes , for PushButton on Linux i use 26 (Text only) or 30 (Icon and Text)

In one project I have code which walks over all controls in a window.
And for Linux it increases all PushButtons in height. But for Mac the height is 20 pixels.

You’re right. 20 pixels is the standard size. I mixed up with label.