Re: PDFView drawPage called often after selecting text

2013-01-09 Thread Kyle Sluder
On Jan 8, 2013, at 11:43 PM, Martin Hewitson martin.hewit...@aei.mpg.de 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

Re: PDFView drawPage called often after selecting text

2013-01-09 Thread Martin Hewitson
On Jan 9, 2013, at 09:25 AM, Kyle Sluder k...@ksluder.com wrote: On Jan 8, 2013, at 11:43 PM, Martin Hewitson martin.hewit...@aei.mpg.de wrote: Some interesting points/problems - if I use -drawPage: instead, then the focus ring has the wrong size and overlaps the displayed pages.

Re: PDFView drawPage called often after selecting text

2013-01-08 Thread Kyle Sluder
On Jan 7, 2013, at 9:16 AM, Martin Hewitson martin.hewit...@aei.mpg.de wrote: On 7, Jan, 2013, at 05:52 PM, Kyle Sluder k...@ksluder.com wrote: 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

Re: PDFView drawPage called often after selecting text

2013-01-08 Thread Martin Hewitson
On Jan 8, 2013, at 09:21 AM, Kyle Sluder k...@ksluder.com wrote: On Jan 7, 2013, at 9:16 AM, Martin Hewitson martin.hewit...@aei.mpg.de wrote: On 7, Jan, 2013, at 05:52 PM, Kyle Sluder k...@ksluder.com wrote: On Jan 7, 2013, at 2:48 AM, Martin Hewitson martin.hewit...@aei.mpg.de

Re: PDFView drawPage called often after selecting text

2013-01-08 Thread Andy Lee
On Jan 7, 2013, at 10:02 PM, Martin Hewitson martin.hewit...@aei.mpg.de 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

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 pops the

Re: PDFView drawPage called often after selecting text

2013-01-08 Thread Andy Lee
On Jan 8, 2013, at 3:59 AM, Martin Hewitson martin.hewit...@aei.mpg.de 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

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

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

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 {

Re: PDFView drawPage called often after selecting text

2013-01-07 Thread Kyle Sluder
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

Re: PDFView drawPage called often after selecting text

2013-01-07 Thread Martin Hewitson
On 7, Jan, 2013, at 05:52 PM, Kyle Sluder k...@ksluder.com wrote: 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

Re: PDFView drawPage called often after selecting text

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

Re: PDFView drawPage called often after selecting text

2013-01-07 Thread Andy Lee
On Jan 7, 2013, at 12:07 PM, Andy Lee ag...@mac.com 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

Re: PDFView drawPage called often after selecting text

2013-01-07 Thread Martin Hewitson
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?

Re: PDFView drawPage called often after selecting text

2013-01-07 Thread Martin Hewitson
On Jan 7, 2013, at 09:16 PM, Andy Lee ag...@mac.com wrote: On Jan 7, 2013, at 12:07 PM, Andy Lee ag...@mac.com 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:

Re: PDFView drawPage called often after selecting text

2013-01-07 Thread Martin Hewitson
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?