• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Change font and text color of label which is a static NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Change font and text color of label which is a static NSTextField


  • Subject: Change font and text color of label which is a static NSTextField
  • From: Shraddha Karwan <email@hidden>
  • Date: Wed, 3 Jun 2009 15:55:23 +0530

Hi,

I want to change the color and font of a label. I used the below method.
I get no errors but it is not updating the Label with the required changes,


- (NSAttributedString *)setLabelFont:(NSString *)str
{
    NSColor *txtColor = [NSColor redColor];
    NSFont *txtFont = [NSFont boldSystemFontOfSize:12];
    NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:txtFont,
                          NSFontAttributeName, txtColor,
NSForegroundColorAttributeName, nil];
    NSAttributedString *atted = [[[NSAttributedString alloc]
initWithString:str attributes:dict] autorelease];
    return atted;
}


[labelStr setAttributedStringValue:[self setLabelFont:@"Checking for
updates"]];

--
Regards,
Shraddha Karwan
_______________________________________________

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

  • Follow-Ups:
    • Re: Change font and text color of label which is a static NSTextField
      • From: Andy Lee <email@hidden>
    • Re: Change font and text color of label which is a static NSTextField
      • From: Andrew Farmer <email@hidden>
  • Prev by Date: Scheduling an application
  • Next by Date: Re: Change font and text color of label which is a static NSTextField
  • Previous by thread: Re: Scheduling an application
  • Next by thread: Re: Change font and text color of label which is a static NSTextField
  • Index(es):
    • Date
    • Thread