Hi all,
i am novice in cocoa so please bear with me ..

I have created an URL link in one my custom applications About box as
described below

NSMutableAttributedString *string =  [[NSMutableAttributedString alloc]
initWithString:@"Cocoa Inc"];

NSRange selectedRange = NSMakeRange(0, 10);
NSURL *linkURL = [NSURL URLWithString:@"http://www.apple.com/";];
[string beginEditing];
[string addAttribute:NSLinkAttributeName
               value:linkURL
               range:selectedRange];
[string addAttribute:NSForegroundColorAttributeName
               value:[NSColor blueColor]
               range:selectedRange];
[string addAttribute:NSUnderlineStyleAttributeName
               value:[NSNumber numberWithInt:NSSingleUnderlineStyle]
               range:selectedRange];
[string endEditing];


I have binded this Attributed string to a Label. I was able to get an URL
link in my About Box, clicking on it will open the browser. But i am facing
a problem with this,

The first time i open the About Box screen i am unable to click on the link.
!!! I have to click on the frame of the Label Once , then the font of the
link will change and  mouse pointer will reform to a hand(clickable)
pointer. !!
How do i fix this problem???

thanks in advance for all the help.
~Arjun
_______________________________________________

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 arch...@mail-archive.com

Reply via email to