Fwd: Strange problem with NSTextView (was NSTextView colors & styles)
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.