NSTextView Scrollbar Bug
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.