On 9 Jan 2009, at 10:07 pm, rethish wrote:

   NSArray *path=[[NSFontManager alloc]  availableFonts];


I take it this is merely a typo; you surely mean:

[[NSFontManager sharedFontManager] availableFonts];

Using:     [textview setFont:fontobj];

Where fontobj is an object of nsfont.

But the problem is ,if we select any item from the popupbutton ,the entire
text's font is changed from the textview.

I really want to set font whenever we select an item


This is exactly what the documentation says it will do.

Instead try:

[myTextView setFont:fontObj range:[myTextView rangeForUserCharacterAttributeChange]];

Bear in mind the comments in the docs for that method regarding undo. Also, you might need to use:

-setTypingAttributes: to seta font ready for typing when the text or selection range is empty.

hth,

Graham


_______________________________________________

Cocoa-dev mailing list ([email protected])

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]

Reply via email to