NSTextField or NSTextView with fixed baseline
NSTextField or NSTextView with fixed baseline
- Subject: NSTextField or NSTextView with fixed baseline
- From: Jon Steinmetz <email@hidden>
- Date: Thu, 06 Oct 2005 15:51:21 -0500
I have a need to have a NSTextField or NSTextView with an arbitrarily
fixed baseline. What I mean by this is that I need to be able to
specify where the baseline of the text is to appear within the frame
of the view. Any changes made by the user to the text or its
attributes should always be rendered with this baseline even if it
means that the text pushes off the top of the view.
Why I need this is that I am providing an editable text preview area
in a dialog that needs to look like what the text will look like when
it is drawn elsewhere in the app. Since the other places this text
will be drawn have a fixed baseline it is considered important to
have the baseline in the editing area match.
My current prototype uses an NSTextView with no border or background
drawing but this has (at least) two problems. The first is that the
text will wrap and the second is that I have no control over the
baseline, the text lines are anchored to the top of the frame of the
text view. I could use NSTextField to solve the line wrapping if I
can still edit and retrieve RTF text. Since a NSTextView is used as
the field editor there must also be a way to make NSTextView not wrap
lines.
After researching what it will take to address the baseline issue I
find myself thinking I might need to provide subclasses of
NSTextContainer or NSTypesetter or both. Since this seems complicated
and daunting I thought I would toss this out to cocoa-dev and see if
anyone has any easier answers to this problem or could provide
pointers to some example that I may have missed.
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden