NSButton Aligned to the Right
I want to have a check box, like the standard one (first the check box and on the right its title) but I want it to be aligned from the开发者_Python百科 right. If I change the alignment to the right then only the text will move to the right but the button itself will still be at the left.
How would I achieve this without knowing the bounds of the NSButton?
Read about Interface Layout in the Interface Builder user guide. As it turns out, just make your checkbox as big as you need to initially, and then set the struts and springs to make it resize correctly as it changes.
To do the same thing in code, read about the setAutoresizingMask:
method in NSView.
精彩评论