• 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
NSTextView Scrollbar Bug
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTextView Scrollbar Bug


  • Subject: NSTextView Scrollbar Bug
  • From: Seth Willits <email@hidden>
  • Date: Fri, 2 Apr 2004 13:15:37 -0800

Do any of you know about this bug? Or I wonder if it really really is a bug, but it's obviously wrong in some form or other. Anyway, if you have SubEthaEdit, open it up, make sure text wrapping is off, make a line that's wider than the field, and resize the window to be smaller than it is. You'll notice that the horizontal scrollbar "jumps" to the right a little bit. This is extremely annoying. I say this is a NSTextView bug because it happens in my application too! Perhaps there is a work around for it?

The code to toggle text wrapping is as follows:



- (void)setTextWrap:(bool)on
{
// Set
mTextWrapOn = on;

// Act
if (mTextWrapOn) {

// Make Wrapping
[[self enclosingScrollView] setHasHorizontalScroller:NO];
[[self textContainer] setContainerSize:NSMakeSize([self frame].size.width, 1.0e7)];
[[self textContainer] setWidthTracksTextView: NO];
[[self textContainer] setHeightTracksTextView: NO];
[self setMaxSize:NSMakeSize([self frame].size.width, 1.0e7)];
[self setHorizontallyResizable: NO];

} else {

// Make Non-Wrapping
[[self enclosingScrollView] setHasHorizontalScroller:YES];
[[self textContainer] setContainerSize:NSMakeSize(1.0e7, 1.0e7)];
[[self textContainer] setWidthTracksTextView: NO];
[[self textContainer] setHeightTracksTextView: NO];
[self setMaxSize:NSMakeSize(1.0e7, 1.0e7)];
[self setHorizontallyResizable: YES];
}
}


I put that together from some code on this list and elsewhere. It works, but hopefully it's "correct."



Thanks for any insight,


Seth Willits
------------------------------------------------------------------------ ---
President and Head Developer of Freak Software - http://www.freaksw.com
REALbasic Guru at ResExcellence - http://www.resexcellence.com/realbasic
Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames

"Standing up for what you believe in is never a waste of time."
------------------------------------------------------------------------ ---
_______________________________________________
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.


  • Prev by Date: Re: New XML support in Cocoa? Re: Java or Objective-C for Cocoa?
  • Next by Date: Re: Lockup Problem with Progress Indicator
  • Previous by thread: Re: New XML support in Cocoa? Re: Java or Objective-C for Cocoa?
  • Next by thread: -undoManagerForTextView: question
  • Index(es):
    • Date
    • Thread