On Jan 7, 2013, at 09:07 PM, Andy Lee <ag...@mac.com> wrote:

> On Jan 7, 2013, at 2:10 AM, Martin Hewitson <matin.hewit...@aei.mpg.de> wrote:
>> I've also checked that -setNeedsDisplay: is not being called on the PDFView.
> 
> Could it be that setNeedsDisplay: isn't called but setNeedsDisplayInRect: is?

I checked that as well. It's not being called during these -drawPage: calls.

> 
> On Jan 7, 2013, at 2:48 AM, Martin Hewitson <martin.hewit...@aei.mpg.de> 
> wrote:
>> Actually, at the risk of having a conversation with myself, I've narrowed 
>> the issue down to the actions I'm taking within my override of -drawPage:. 
>> Essentially what I'm aiming at is having a focus ring on the PDFView. I do 
>> this in my PDFView subclass:
>> 
>> - (void)drawPage:(PDFPage *)page {
>> [super drawPage:page];
>> // focussed?
>> if ([[self window] firstResponder] == self && [NSApp isActive]) {    
>>      [[self superview] lockFocus];
>>      NSRect fr = [self frame];
>>      NSSetFocusRingStyle(NSFocusRingOnly);
>>      [[NSBezierPath bezierPathWithRect:fr] fill];
>>      [[self superview] unlockFocus];
>> }
>> }
> 
> I'm not hugely familiar with PDFKit, so this may be a naive question, and it 
> definitely delves into wild speculation...
> 
> Why do you override drawPage: rather than drawRect:?

Sorry, missed this question in my last reply. I've tried -drawRect: but that is 
not called on PDFView, as far as I can tell. I tried overridding this in my 
subclass and put in an NSLog there, but it's never called. Hence my use of 
-drawPage:.

Cheers,

Martin



_______________________________________________

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

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

Reply via email to