Re: PDFView drawPage called often after selecting text
Re: PDFView drawPage called often after selecting text
- Subject: Re: PDFView drawPage called often after selecting text
- From: Martin Hewitson <email@hidden>
- Date: Tue, 08 Jan 2013 08:33:45 +0100
On Jan 7, 2013, at 09:07 PM, Andy Lee <email@hidden> wrote:
> On Jan 7, 2013, at 2:10 AM, Martin Hewitson <email@hidden> 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 <email@hidden> 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 (email@hidden)
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:
This email sent to email@hidden