• 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
Re: NSTextViews with embedded pictures and vertical alignment
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextViews with embedded pictures and vertical alignment


  • Subject: Re: NSTextViews with embedded pictures and vertical alignment
  • From: Nicko van Someren <email@hidden>
  • Date: Tue, 29 Jun 2004 23:32:02 +0100

Text attachments in the form of a NSTextAttachment need provide an object that conforms to the NSTextAttachmentCell protocol which will be used to draw the attachment representation and handle clicks. The protocol has the following method:

- (NSPoint)cellBaselineOffset
Returns the position where the attachment cell's image should be drawn in text, relative to the current point established in the glyph layout. The image should be drawn so its lower-left corner lies on this point.

At a guess if you make this return a point with a negative Y value then when the cell is laid out it will be placed descending below the text base line. I've not tried it however...

Cheers,
Nicko

On 29 Jun 2004, at 21:46, John Stiles wrote:

Right now I have an NSTextView with a decent-sized icon embedded in it (as an attachment), followed by some text.
The NSTextView is making the text appear at the bottom edge of the icon, so it looks like this (excuse the goofy ASCII art)

/\
/!\
/___\ Here is the message way down at the bottom.

I'd like to vertically align the text so it looks like this:

/\
/!\ The text is positioned in the middle now.
/___\

Is this doable?
_______________________________________________
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.


  • Follow-Ups:
    • Re: NSTextViews with embedded pictures and vertical alignment
      • From: Douglas Davidson <email@hidden>
References: 
 >NSDateFormatter not validating input (From: David Alter <email@hidden>)
 >NSTextViews with embedded pictures and vertical alignment (From: John Stiles <email@hidden>)

  • Prev by Date: Using GCContextFillRect() vs. NSBezierPath's class methods
  • Next by Date: Saving arrays with NSUserDefaults?
  • Previous by thread: NSTextViews with embedded pictures and vertical alignment
  • Next by thread: Re: NSTextViews with embedded pictures and vertical alignment
  • Index(es):
    • Date
    • Thread