• 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
Inserting an NSTextAttachmentCell of type Text?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: NSTextField: how to make the text cursor blink?
  • Next by Date: Re: NSTextField delegate that will monitor user input
  • Previous by thread: [Solved] Re: NSTextField: how to make the text cursor blink?
  • Next by thread: Subclassing NSCell
  • Index(es):
    • Date
    • Thread