• 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: Making NSTextView not wrap lines
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making NSTextView not wrap lines


  • Subject: Re: Making NSTextView not wrap lines
  • From: Jonathan Dann <email@hidden>
  • Date: Thu, 30 Jul 2009 14:57:45 +0200

From the archives:

http://www.cocoabuilder.com/archive/message/cocoa/2008/5/23/207981

On 28 Jul 2009, at 18:11, Peter Mulholland wrote:

Hello cocoa-dev,

Basically, i'm trying to do a little debug console. I'm using the NSTextView in NSScrollView from Interface Builder.

I've got a Print member in my window's controller class which basically does:

[TextView setString:[[TextView string] stringByAppendingString:newString]];

What I want is for the horizontal size of the NSTextView part to expand to the length of the string. I'm guessing NSTextView already knows about \n and how to make a suitable rectangular area out of a string.

I've set the Text View portion to be horizontally and vertically resizeable. I've also made sure it's only autosizing vertically, so that the Scroll View will show a horizontal scroll bar.

By default, it doesnt work. I add text with Print, and it always wraps. If I size my window (which resizes the ScrollView) wide enough, the text goes onto one line. When i size it smaller, the horizontal scroll bar appears as expected.

I have tried calling sizeToFit after the setString, but it doesn't do anything.

This is probably a really simple job, but i'm out of ideas! I'm just starting with Cocoa, really.

--
Best regards,
Peter                          mailto:email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Making NSTextView not wrap lines (From: Peter Mulholland <email@hidden>)

  • Prev by Date: Re: Hyperlinks in NSAttributedString?
  • Next by Date: Re: NSString and regular expressions
  • Previous by thread: Re: Making NSTextView not wrap lines
  • Next by thread: Anyone Using ZeroC's Internet Communications Engine (ICE)?
  • Index(es):
    • Date
    • Thread