• 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
One-line TextViews
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

One-line TextViews


  • Subject: One-line TextViews
  • From: Scott Thompson <email@hidden>
  • Date: Thu, 13 May 2004 12:26:10 -0500

I'm trying to implement an text entry area that allows the user to edit short, one-line segments of "rich text".

At first, I put in an NSTextField and quickly realized that NSTextField constrains it's text to a single set of font attributes. My needs are a bit more complex in that I would like to allow the user to change the font style, color, underline, and other attributes of the text arbitrarily along the line. Some changes, like font size, may need to be constrained, but many others are free to vary.

I turned my attention to NSTextView but have been dissatisfied by the support that IB gives me when creating a TextView. The view I can drag off the IB palette, for example, allows for multiple lines and is automagically embedded in a scroll view. I couldn't find any way to extract the TextView from the scroll view and use it on its own.

What I did to get my text views onto the screen was add a custom view and set it's custom class to NSTextView. This works pretty well in terms of the view's runtime behavior, but is very cumbersome to work with (particularly for those kinds of attributes that one would normally change in Interface Builder).

All in all, I'm struggling with a very un-Cocoa-Like experience while trying to get these little Text Views to work and that makes me think that I'm going about things the hard way.

Can anyone suggest a more efficient way to work with small TextViews that fit the description above?

Scott
_______________________________________________
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: One-line TextViews
      • From: Ali Ozer <email@hidden>
  • Prev by Date: Re: Is there a regular expression class for Objective C?
  • Next by Date: Automate MS PowerPoint X using cocoa?
  • Previous by thread: Re: window rotation
  • Next by thread: Re: One-line TextViews
  • Index(es):
    • Date
    • Thread