PDFView with a 'small' frame
PDFView with a 'small' frame
- Subject: PDFView with a 'small' frame
- From: Phil <email@hidden>
- Date: Sat, 17 Sep 2005 21:32:02 -0400
I've noticed some strange behavior creating PDFViews programatically
(i.e. this doesn't seem to happen if I create the PDFView in a window
using IB which tells me something required is not being set?) and am
hoping someone will have some insight as to what is missing.
It seems that if the frame size is small enough (in trying different
settings it appears that this is just about any value smaller than
the size of what PDFPage boundsForBox: returns for the height or
width), then the PDFView will go into a state of constant refresh or
will remain grey and go to 100% CPU utilization. Here's a code
snippet to create the PDFView as subview which illustrates the problem:
PDFDocument *newDoc;
PDFView *thispdfview;
NSURL *theURL;
theURL = [NSURL fileURLWithPath: @"<PDF filename>"];
newDoc = [[PDFDocument alloc] initWithURL: theURL];
// NSRect myRect = { { 0,0 }, { 150, 200 } }; // this doesn't
work so well
NSRect myRect = { { 0,0 }, { 700, 900 } };
thispdfview = [[PDFView alloc] init];
[thispdfview setDocument: newDoc];
[thispdfview setFrame: myRect];
[thispdfview goToPage: [newDoc pageAtIndex: 0]];
[self addSubview: thispdfview];
This form works as expected. However, if you replace the NSRect
definition with the commented version the issue is observed.
Phil
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden