selectCellWithTag: tries to ruin my night
selectCellWithTag: tries to ruin my night
- Subject: selectCellWithTag: tries to ruin my night
- From: Stéphane Sudre <email@hidden>
- Date: Fri, 13 Feb 2004 00:11:17 +0100
Is there a simple method to solve the following issue?
I have a bunch of NSMatrix of radio buttons inside a NSScrollView (ok
there's a NSClipView between them and another NSView again).
When I use selectCellWithTag: to set the values of the radio buttons,
the NSScrollView is scrolled to display the newly selected cell (in
case it's changed).
As far as I can see, this incorrect behavior (in this particular case)
is caused by the scrollCellToVisibleAtRow:column: method.
I worked around this by subclassing NSMatrix and adding these methods:
+ (void) setAutoScrollToVisible:(BOOL) aBool
{
_scrollCellToVisible_=aBool;
}
- (void)scrollCellToVisibleAtRow:(int)row column:(int)column
{
if (_scrollCellToVisible_==YES)
{
[super scrollCellToVisibleAtRow:row column:column];
}
}
- (BOOL) selectCellWithTagNoScrolling:(int) tag
{
BOOL tValue;
[PBMatrix setAutoScrollToVisible:NO];
tValue=[self selectCellWithTag:tag];
[PBMatrix setAutoScrollToVisible:YES];
return tValue;
}
and invoking selectCellWithTagNoScrolling: instead of
selectCellWithTag:.
Now the question is: "is there an easier way to do this?"
_______________________________________________
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.