I don't get it. If a user can not underline the text directly from interface builder, then why is the option given in the font window ? Adil
--- On Tue, 11/4/08, Jonathan Hess <[EMAIL PROTECTED]> wrote: From: Jonathan Hess <[EMAIL PROTECTED]> Subject: Re: Underlining text in Interface Builder To: [EMAIL PROTECTED] Cc: cocoa-dev@lists.apple.com Date: Tuesday, November 4, 2008, 12:09 PM Hey Adil - A text label in Interface Builder is an NSTextField, which has an NSTextFieldCell. NSTextFieldCell has three related properties, stringValue, font, and attributedStringValue. When the cell has just a stringValue, and a font, it combines the two during drawing to draw the string with the specified font. An attributed string is a much richer combination of a string and styling directives, when a text field cell has a specified attributed string value, it will use that for drawing. Even though the underlining attribute is present on the font panel, it isn't actually a property of fonts. Instead, underlining is an attribute that you can specify for a range of characters in an attributed string independent of the font. In order to have a NSTextField/NSTextFieldCell pair with underlined text, you would need to use the attributed string instead of the simple string + font. Unfortunately, Interface Builder only supports configuring the string and font, not the attributed string. I suggest filing an enhancement request at http://bugreport.apple.com/ Jon Hess On Nov 4, 2008, at 12:37 AM, Adil Saleem wrote: > Hi, > > I am trying to underline a static text in Interface Builder (through fonts window), but it does not underline the text. I don't understand why. Any ideas ? > > Thanx > > > > _______________________________________________ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/cocoa-dev/jhess%40apple.com > > This email sent to [EMAIL PROTECTED] _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]