• 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
selectCellWithTag: tries to ruin my night
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: How do you find an underlying view?
  • Next by Date: Java bridge: Java method with 2 arguments
  • Previous by thread: Re: BUG ? kCGDesktopWindowLevel and Expose
  • Next by thread: Java bridge: Java method with 2 arguments
  • Index(es):
    • Date
    • Thread