Re: How to get the white shadow effect when drawing NSStrings?

2009-02-22 Thread Ken Ferry
CC: cocoa-dev@lists.apple.com From: bwal...@gmail.com To: ulaibee...@hotmail.com Subject: Re: How to get the white shadow effect when drawing NSStrings? Date: Sat, 21 Feb 2009 06:22:25 -0500 Use a cell to draw your text and call -setBackgroundStyle: on it with the parameter

Re: How to get the white shadow effect when drawing NSStrings?

2009-02-22 Thread Graham Cox
On 23/02/2009, at 4:43 AM, Ken Ferry wrote: This effect cannot be implemented with text attributes. Are you sure? This gets awfully close, unless I'm missing the point here (the font to use your choice): + (NSDictionary*) defaultTitleAttributes { // return the dictionary used to

Re: How to get the white shadow effect when drawing NSStrings?

2009-02-22 Thread Ken Ferry
Yes, I'm sure. :-) You won't get the subpixel font smoothing right, if nothing else. Also, the other method tracks whatever the current human interface design is for text on a raised surface. -Ken On Sun, Feb 22, 2009 at 2:16 PM, Graham Cox graham@bigpond.com wrote: On 23/02/2009, at 4:43

Re: How to get the white shadow effect when drawing NSStrings?

2009-02-22 Thread Graham Cox
On 23/02/2009, at 9:38 AM, Ken Ferry wrote: Yes, I'm sure. :-) You won't get the subpixel font smoothing right, if nothing else. Are you saying that using a shadow attribute turns off or interferes with subpixel font smoothing? That seems a bit strange. --Graham

Re: How to get the white shadow effect when drawing NSStrings?

2009-02-22 Thread Steve Christensen
It seems like the best solution would be to handle both the Leopard+ and pre-Leopard cases at runtime so any changes to HID over time are non-issues since you've limited the custom code to the pre-Leopard case. You might be able to get away with as little as adding a category to NSCell

How to get the white shadow effect when drawing NSStrings?

2009-02-21 Thread Ulai Beekam
Hi, Just take a look at any toolbar text in Leopard. It has a subtle, white shadow. How can I get this very same effect in my own app when using NSString's drawInRect method? What attributes to use? Do you have any sample code? Thanks, U.

Re: How to get the white shadow effect when drawing NSStrings?

2009-02-21 Thread Brandon Walkin
Use a cell to draw your text and call -setBackgroundStyle: on it with the parameter NSBackgroundStyleRaised. That'll apply the exact same shadow that's used on toolbar item labels. Keep in mind that this method is Leopard-only. On 21-Feb-09, at 6:10 AM, Ulai Beekam wrote: Hi, Just take

Re: How to get the white shadow effect when drawing NSStrings?

2009-02-21 Thread Simone Tellini
Il giorno 21/feb/09, alle ore 12:22, Brandon Walkin ha scritto: Use a cell to draw your text and call -setBackgroundStyle: on it with the parameter NSBackgroundStyleRaised. That'll apply the exact same shadow that's used on toolbar item labels. Keep in mind that this method is

RE: How to get the white shadow effect when drawing NSStrings?

2009-02-21 Thread Ulai Beekam
since it also has the net effect of making the letters look thinner. CC: cocoa-dev@lists.apple.com From: bwal...@gmail.com To: ulaibee...@hotmail.com Subject: Re: How to get the white shadow effect when drawing NSStrings? Date: Sat, 21 Feb 2009 06:22:25

Re: How to get the white shadow effect when drawing NSStrings?

2009-02-21 Thread Graham Cox
On 22/02/2009, at 1:22 AM, Ulai Beekam wrote: Is there no way to do it without a cell? I ask because I'm writing my own custom view and need to be able to do this with NSString's drawInRect, using a correct font attribute. The other poster's suggestion of just using a white text and