Inserting an NSTextAttachmentCell of type Text?
Inserting an NSTextAttachmentCell of type Text?
- Subject: Inserting an NSTextAttachmentCell of type Text?
- From: Thomas Lachand-Robert <email@hidden>
- Date: Thu, 4 Dec 2003 23:54:41 +0100
Hi all,
I'm clearly doing something wrong with text attachments, but I don't
understand what; so if someone has any suggestion.
I try to insert in a tex view an attachment containing some text itself
(in order to have this piece of text treated as a block in selection,
etc.). Here is my code:
acell = [[[NSTextAttachmentCell alloc]
initTextCell:aString] autorelease];
NSTextAttachment *attachment = [[[NSTextAttachment alloc]
initWithFileWrapper:nil] autorelease];
[attachment setAttachmentCell:acell];
insert = [NSAttributedString
attributedStringWithAttachment:attachment];
and then I put "insert" in the text view. But nothing really appears: I
can see that there is a small blank thing which is probably the
attachment, but the text in the cell (from string "aString") doesn't
display. (Note that it is ok if I replace "insert" by an ordinary
string, so this is not the insertion itself).
What did I forget?
Thanks,
Thomas Lachand-Robert
********************** email@hidden
<< Et le chemin est long du projet ` la chose. >> Molihre, Tartuffe.
_______________________________________________
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.