Quantcast
Viewing latest article 1
Browse Latest Browse All 2

Answer by Joshua Nozzi for How to draw a border around an NSTexturedSquareBezelStyle button

Rewritten Answer

I'm not seeing an NSTexturedSquareBezelStyle button showing up borderless in Yosemite:

Image may be NSFW.
Clik here to view.
NSTexturedSquareButonStyle button under Yosemite.

This is a stock button dragged from the palette in Interface Builder. I encourage you to post your code since it's likely you're generating your button in code. Here's my own code for generating the same button:

NSButton * anotherButton = [[NSButton alloc] initWithFrame:NSMakeRect(10.0, 10.0, 100.0, 100.0)];
anotherButton.bezelStyle = NSTexturedSquareBezelStyle;
anotherButton.title = @"Line 1\nLine 2";

Proof:

Image may be NSFW.
Clik here to view.
Same button created with code.

If you're seeing different results under Yosemite, you'll need to post your code. At a guess, you might be initializing your button with -init instead of -initWithFrame:, which can cause all kinds of drawing issues since NSButton is an NSView and therefore its designated initializer is -initWithFrame:. Just a guess though.


Viewing latest article 1
Browse Latest Browse All 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>