• 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
NSTableView and Custom Highlight Functions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTableView and Custom Highlight Functions


  • Subject: NSTableView and Custom Highlight Functions
  • From: Sammi Williams <email@hidden>
  • Date: Wed, 27 Jul 2005 18:24:25 +1200

Hello

I'm having problems trying to get NSTableView to redraw dirty rows. Basically, I have it so that rather than the standard highlighting (each row is highlighed with a basic rect), I have curvy NSBezierPaths that circle the selection with rounded corners. This means, that potentially, when you select two rows next to each other, you need to redraw the other one also, so that the selection encompases both rows accurately.

Currently, it works fine with single selections, however, as above, with multiple rows selected, I have no idea how to indicate that the whole row needs to be redrawn.. potentially I should look at overriding draw- i'm trying to intersect this function, but not having much luck.

- (void)selectRowIndexes:(NSIndexSet *)indexes byExtendingSelection: (BOOL)extend {
int idx = [indexes firstIndex];


    while (idx != NSNotFound) {
        [self setNeedsDisplayInRect:[self rectOfRow:idx]];
        idx = [indexes indexGreaterThanIndex:idx];
    }

    [super selectRowIndexes:indexes byExtendingSelection:extend];
}

Any ideas what I'm doing wrong? Here is a example of the problem: (Sorry for putting image here, i've compressed it down to 1.5kb, i hope this is okay. I'm a university and cannot access my web server at this time..).


As you can see, the single selection is fine, however additional selections draw correctly, its just that the previously selected rows do not redraw.... if they did, it would look as if there was one black loop around the entire selection. If you are to minimize/ maximize the window, or some other action that forces the window to redraw, the selection draws correctly.


Thanks for your time.

Sammi _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Icon question
  • Next by Date: How do you use AuthorizationRuleIsAdmin?
  • Previous by thread: Re: Another NSDocument question
  • Next by thread: How do you use AuthorizationRuleIsAdmin?
  • Index(es):
    • Date
    • Thread