addresbook-like edit cells inside NSTextView

Discussion in 'Mac Programming' started by MrFusion, Jan 1, 2007.

  1. MrFusion macrumors 6502a

    Jun 8, 2005

    When you edit a contact in addresbook, you get a number of fields on which you can click. When you do this a textfield pops up that is editable.
    I am trying to get something similar.

    I already know that I need to use NSAttributedStrings in a NSTextView together with NSTextAttachment. And I need to implement the NSTextAttachmentCell protocol. Almost no NS...Cell implements this (completely).

    First step I did was to try to display some inline buttons with NSTextAttachment. This works, although it isn't nicely positioned with regard to the rest of the text.

    Next was trying to edit the text of the cell. So I subclassed NSTextFieldCell. It displays the text, but is not editable. Although I did try to set the "editable" flag.

    Any ideas how I should procede?

Share This Page