Re: PDFView drawPage called often after selecting text

2013-01-09 Thread Martin Hewitson
On Jan 9, 2013, at 09:25 AM, Kyle Sluder wrote: > On Jan 8, 2013, at 11:43 PM, Martin Hewitson > wrote: > >> Some interesting points/problems >> >> - if I use -drawPage: instead, then the focus ring has the wrong size and >> overlaps the displayed pages. Don't know why. >> - doing this in -

Re: PDFView drawPage called often after selecting text

2013-01-09 Thread Kyle Sluder
On Jan 8, 2013, at 11:43 PM, Martin Hewitson wrote: > Some interesting points/problems > > - if I use -drawPage: instead, then the focus ring has the wrong size and > overlaps the displayed pages. Don't know why. > - doing this in -drawPage: or -drawPagePost: solves the issue I was having > - u

Re: PDFView drawPage called often after selecting text

2013-01-08 Thread Martin Hewitson
Andy, Kyle, Thank you both for your assistance on this. I've got something working now which doesn't cause the responsiveness issues and even looks visually more pleasant. Here's the solution: - (void) drawPagePost:(PDFPage *)page { [super drawPagePost:page]; if ([[self window]

Re: PDFView drawPage called often after selecting text

2013-01-08 Thread Andy Lee
On Jan 8, 2013, at 3:59 AM, Martin Hewitson wrote: > Maybe not. I just didn't know about this, but I will read up on it. However, > as far as my tests show, -drawRect: is never called on PDFView. This seemed really odd, so I checked and it turns out there is a view hierarchy under PDFView. When

Re: PDFView drawPage called often after selecting text

2013-01-08 Thread Kyle Sluder
On Tue, Jan 8, 2013, at 07:58 AM, Andy Lee wrote: > You're already calling setKeyboardFocusRingNeedsDisplayInRect: in > become/resignFirstResponder, which seems like the right place. But I > notice Apple's "Dicey" example project uses NSSetFocusRingStyle > differently than you do. It pushes and pop

Re: PDFView drawPage called often after selecting text

2013-01-08 Thread Andy Lee
On Jan 7, 2013, at 10:02 PM, Martin Hewitson wrote: > Yes, that's right. But doesn't help the problem, unfortunately. The PDFView > is not the first responder when I'm typing, so the 'fault' is triggered when > the PDFView first becomes first responder then the NSSetFocusRingStyle part > of th

Re: PDFView drawPage called often after selecting text

2013-01-08 Thread Martin Hewitson
On Jan 8, 2013, at 09:21 AM, Kyle Sluder wrote: > On Jan 7, 2013, at 9:16 AM, Martin Hewitson > wrote: > >> >> On 7, Jan, 2013, at 05:52 PM, Kyle Sluder wrote: >> >>> On Jan 7, 2013, at 2:48 AM, Martin Hewitson >>> wrote: >>> Actually, at the risk of having a conversation with myse

Re: PDFView drawPage called often after selecting text

2013-01-08 Thread Kyle Sluder
On Jan 7, 2013, at 9:16 AM, Martin Hewitson wrote: > > On 7, Jan, 2013, at 05:52 PM, Kyle Sluder wrote: > >> On Jan 7, 2013, at 2:48 AM, Martin Hewitson >> wrote: >> >>> Actually, at the risk of having a conversation with myself, I've narrowed >>> the issue down to the actions I'm taking w

Re: PDFView drawPage called often after selecting text

2013-01-07 Thread Martin Hewitson
On Jan 7, 2013, at 09:07 PM, Andy Lee wrote: > On Jan 7, 2013, at 2:10 AM, Martin Hewitson 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

Re: PDFView drawPage called often after selecting text

2013-01-07 Thread Martin Hewitson
On Jan 7, 2013, at 09:16 PM, Andy Lee wrote: > On Jan 7, 2013, at 12:07 PM, Andy Lee wrote: >> It does seem weird that drawPage: is getting called when you aren't even >> interacting with the PDFView. > > Come to think of it, this is *really* weird since your drawPage: checks > whether the P

Re: PDFView drawPage called often after selecting text

2013-01-07 Thread Martin Hewitson
On Jan 7, 2013, at 09:07 PM, Andy Lee wrote: > On Jan 7, 2013, at 2:10 AM, Martin Hewitson 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? > > On Jan 7, 2013, at 2:48 AM, M

Re: PDFView drawPage called often after selecting text

2013-01-07 Thread Andy Lee
On Jan 7, 2013, at 12:07 PM, Andy Lee wrote: > It does seem weird that drawPage: is getting called when you aren't even > interacting with the PDFView. Come to think of it, this is *really* weird since your drawPage: checks whether the PDFView is first responder -- which it can't be if you're i

Re: PDFView drawPage called often after selecting text

2013-01-07 Thread Andy Lee
On Jan 7, 2013, at 2:10 AM, Martin Hewitson 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? On Jan 7, 2013, at 2:48 AM, Martin Hewitson wrote: > Actually, at the risk of having a

Re: PDFView drawPage called often after selecting text

2013-01-07 Thread Martin Hewitson
On 7, Jan, 2013, at 05:52 PM, Kyle Sluder wrote: > On Jan 7, 2013, at 2:48 AM, Martin Hewitson > 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

Re: PDFView drawPage called often after selecting text

2013-01-07 Thread Kyle Sluder
On Jan 7, 2013, at 2:48 AM, Martin Hewitson 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

Re: PDFView drawPage called often after selecting text

2013-01-07 Thread Martin Hewitson
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 { [supe

PDFView drawPage called often after selecting text

2013-01-07 Thread Martin Hewitson
Dear list, I have an app which has a main split view. In the left panel there is a text editor (NSTextView), in the right panel there is a PDFView. I find that when typing in the text view, the -drawPage: method of the PDFView is called about once every 200ms but only if the PDFView is displayi