Re: NSScrollerView Problem
Re: NSScrollerView Problem
- Subject: Re: NSScrollerView Problem
- From: Randall Meadows <email@hidden>
- Date: Tue, 28 Aug 2007 15:15:53 -0600
At 10:45 AM -0700 8/28/07, Erik Buck wrote:
Ask yourself what those buttons on the scroll bar do? They scroll
line by line or page by page. Now ask yourself, how does the
framework know how far to scroll in order to scroll line by line ?
Is it possible that you have set the verticalLineScroll to zero or
allowed it to remain zero ?
OK, the verticalLineScroll is indeed zero. I ran a previous version
that behaved correctly and the value was 10. Ok, now we're getting
somewhere! Except...
NOWHERE is any of the setLineScroll methods called. Not in the
current, broken version NOR the previous, working version. Is that
value defaulted to somehow/someway that is non-obvious (or obvious,
and I'm just being thick)?
There's clearly something going on here I don't understand. I put in
some logging calls:
NSLog(@"[[self superview] superview] class is %@.", [[[self
superview] superview] class]);
NSLog(@"lineScroll is %f.", [[[self superview] superview] verticalLineScroll]);
[[[self superview] superview] setVerticalLineScroll:50.0];
NSLog(@"lineScroll is %f.", [[[self superview] superview] verticalLineScroll]);
in the version that works. Here's the output:
2007-08-28 15:02:51.590 Cliq[20133] [[self superview] superview]
class is NSScrollView.
2007-08-28 14:02:51.590 Cliq[20133] lineScroll is 0.000000.
Hmmm, but the scrolling works, even though the value is 0. What?
(gdb) p (float)[[[self superview] superview] verticalLineScroll]
$2 = 10
But wait a minute; the object in GDB doesn't think the value is 0!
Let's try setting it to something manually:
[[[self superview] superview] setVerticalLineScroll:50.0];
NSLog(@"lineScroll is %f.", [[[self superview] superview] verticalLineScroll]);
produces:
2007-08-28 14:03:22.961 Cliq[20133] lineScroll is 0.000000.
AND the scrolling is now broken. Similar behavior occurs if I change
the value from within gdb, using:
(gdb) call (void)[[[self superview] superview] setVerticalLineScroll:50.0];
(gdb) p (float)[[[self superview] superview] verticalLineScroll]
$3 = 0
Where does the initial value of 10 come from? And why does it break
completely when I manually set it to 50? And why the difference
between output from the application versus from within gdb? (The gdb
command were issued while sitting at breakpoints set on the NSLog()
calls above, so it was in the exact same place in the code for both.)
This is all in the previous version, BTW. I'm still trying to figure
out where/how it got changed in the current version.
_______________________________________________
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