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

2009-06-03 Thread Shraddha Karwan
Thank You Andy. That was the cause. Changed the location of the statement from init to awakeFromnib and its working. On Wed, Jun 3, 2009 at 6:22 PM, Andy Lee wrote: > On Jun 3, 2009, at 6:25 AM, Shraddha Karwan wrote: > >> [labelStr setAttributedStringValue:[self setLabelFont:@"Checking for >>

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

2009-06-03 Thread Andy Lee
On Jun 3, 2009, at 6:25 AM, Shraddha Karwan wrote: [labelStr setAttributedStringValue:[self setLabelFont:@"Checking for updates"]]; I suspect labelStr is nil. When are you executing this line? If labelStr is an outlet and you are doing it in an init method, that is too early -- labelStr h

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

2009-06-03 Thread Shraddha Karwan
Yes, Checking / Unchecking this field doesn't make any change. I can still use the setColor and setFont methods even if the Rich Text field is disabled. On Wed, Jun 3, 2009 at 5:16 PM, rajesh wrote: > did you try checking the Allows "Rich Text" field in Interface Builder for > labelStr ? > > __

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

2009-06-03 Thread rajesh
did you try checking the Allows "Rich Text" field in Interface Builder for labelStr ? On Jun 3, 2009, at 1:13 PM, Shraddha Karwan wrote: IBOutlet NSTextField *labelStr; I have linked this labelStr with the Label I created in my Interface Builder. I am able to change its attributes using [

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

2009-06-03 Thread Shraddha Karwan
IBOutlet NSTextField *labelStr; I have linked this labelStr with the Label I created in my Interface Builder. I am able to change its attributes using [labelStr setTextColor:[NSColor redColor]]; [labelStr setFont:[NSFont labelFontOfSize:10]]; But the setAttributedStringValue doesn't seem to work

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

2009-06-03 Thread Andrew Farmer
On 3 Jun 2009, at 03:25, Shraddha Karwan wrote: 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 redColo

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

2009-06-03 Thread Shraddha Karwan
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 boldSystemFont