On 18/08/2009, at 9:50 PM, Graham Cox wrote:

Here's a fun little method I wrote to explore this - it just fakes an event that gradually tracks from the top of the table to the bottom. As you can see, you wouldn't really expect it to draw anything, but it does highlight each row in turn. The call to the window's -displayIfNeeded is required to flush the drawing out during the loop. <mLayersTable> is the ivar for the tableview (in fact an outline view - I haven't tested this against a table view).


A few more clues/results...

The highlight is being drawn by drawRect: as usual - I was thinking that some direct drawing was being done but that's not the case on further investigation.

After running the test code, the table highlighting gets firmly set to the blue outline style for ALL further selections. This suggests that - menuForEvent is setting a highlighting style mode, making a note of the row to highlight and then doing the drawing in -drawRect: Am I warm, Corbin?

I still say that -menuForEvent: is the wrong place to be setting these internal flags - the internal client of -menuForEvent: should be doing that (-rightMouseDown: or something it calls) - plus the highlighting "mode" should be public so that delegate methods that customise highlighting could make use of it.

--Graham


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to