• 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
Fwd: Strange problem with NSTextView (was NSTextView colors & styles)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: Strange problem with NSTextView (was NSTextView colors & styles)


  • Subject: Fwd: Strange problem with NSTextView (was NSTextView colors & styles)
  • From: malcom <email@hidden>
  • Date: Fri, 16 Aug 2002 20:52:17 -0700

Ok... now seems all ok:

String input = "kkkk";
NSColor color = NSColor.blueColor();
NSDictionary dict = new NSDictionary(color,NSAttributedString.ForegroundColorAttributeName);
NSAttributedString attstring = new NSAttributedString(input,dict);
main_chatbox.insertText(attstring);

The text is blue. Now i would to set the color and the font size/name.
I have created two NSMutableArray with keys and values. Then i have created my dictionary... so:

NSColor color = NSColor.blueColor();
NSFont fonts = NSFont.fontWithNameAndSize("Courier",9);
NSMutableArray val = new NSMutableArray();
NSMutableArray ke = new NSMutableArray();
val.addObject(color);
val.addObject(fonts);
ke.addObject(NSAttributedString.ForegroundColorAttributeName);
ke.addObject(NSAttributedString.FontAttributeName);
NSDictionary dict = new NSDictionary(val,ke);
NSAttributedString attstring = new NSAttributedString(input,dict);
main_chatbox.insertText(attstring);

With this code all is black... nothing about the color/font size&name...why? Thx at all.
Daniele
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Creating a stand-alone NSToolbar controller
  • Next by Date: Re: NSDocument:windowControllerDidLoadNib && When are outlets connected to te loaded nib?
  • Previous by thread: Re: Creating a stand-alone NSToolbar controller
  • Next by thread: File's Owner
  • Index(es):
    • Date
    • Thread