开发者

How to scale axes independently at runtime on an NSButton

开发者 https://www.devze.com 2023-03-01 18:22 出处:网络
In Interface Builder, you can select how you want a button\'s image to be scaled, choosing either Axes Independent, Proportionally开发者_如何学Python Down, etc. for the \"Scaling\" drop-down. How can

In Interface Builder, you can select how you want a button's image to be scaled, choosing either Axes Independent, Proportionally开发者_如何学Python Down, etc. for the "Scaling" drop-down. How can I access or change this attribute of the NSButton at runtime?


You should be able to set that by using the button’s cell:

NSButton *someButton;

NSButtonCell *someButtonCell = [someButton cell];
[someButtonCell setImageScaling:NSImageScaleAxesIndependently];

For the list of image scaling options, see here.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号