Re: Change Color Of Appended NSString?
Re: Change Color Of Appended NSString?
- Subject: Re: Change Color Of Appended NSString?
- From: "Chunk 1978" <email@hidden>
- Date: Fri, 12 Dec 2008 09:58:19 -0500
thanks for that...
i've noticed that if i don't actively add an NSFontAttributeName to
the attributes, the new attributed string will default as a smaller,
different font... is this normal? if so what is the default font and
size of NSMenuItems?
On Fri, Dec 12, 2008 at 8:21 AM, <email@hidden> wrote:
>
> On 12 Dec 2008, at 14:10, Chunk 1978 wrote:
>
>> i have an NSMenuItem who's title changes programtically. how can i
>> change the color of the appended string?
>>
>> -=-=-=-=-
>> NSString *appendedTimeRemaining = [NSString stringWithFormat:@"%d
>> Hours", [self timeMenuSelection]];
>> [appendedTimeRemaining setColor:[NSColor grayColor]];
>> [MainMenu_Item3 setTitle:[NSString stringWithFormat:@"Stop Clock —
>> %s", appendedTimeRemaining]];
>> -=-=-=-=-
>
>
> NSString doesn't have a setColor method.
>
> I think you just need to use a properly set up NSAttributedString and use
> [NSMenuItem setAttributedTitle].
>
> Matt Gough
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden