• 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
Re: PDFView drawPage called often after selecting text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >PDFView drawPage called often after selecting text (From: Martin Hewitson <email@hidden>)
 >Re: PDFView drawPage called often after selecting text (From: Martin Hewitson <email@hidden>)
 >Re: PDFView drawPage called often after selecting text (From: Andy Lee <email@hidden>)

  • Prev by Date: Re: Printing layer-based view
  • Next by Date: Re: PDFView drawPage called often after selecting text
  • Previous by thread: Re: PDFView drawPage called often after selecting text
  • Next by thread: Re: Cococa-Dev : was [coredata count not fulfill fault after object delete]
  • Index(es):
    • Date
    • Thread