• 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: Creating WebView in code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating WebView in code


  • Subject: Re: Creating WebView in code
  • From: Jenny M <email@hidden>
  • Date: Thu, 1 Apr 2010 19:17:12 -0700

> Not an NSRect, but you can get an NSSize from [[NSPrintInfo sharedPrintInfo] paperSize]. From that, you can build an NSRect with that value for the size and NSZeroPoint for the origin.
>

Great, I'm testing that method now. I get everything built alright,
but during the print operation (while the print panel is shown), the
program crashes with the following message in the console:

-----------------
Debugger() was called!
The Debugger has exited due to signal 2 (SIGINT).The Debugger has
exited due to signal 2 (SIGINT).
-----------------

Now, when the print panel IS shown, the preview is blank, so I know
it's not loading but I can't tell where. Here's the code I'm using..
------------------
NSPrintInfo *printInfo = [NSPrintInfo sharedPrintInfo];
NSSize pageSize = [printInfo paperSize];
NSRect frame = NSMakeRect(0.0, 0.0, pageSize.width, pageSize.height);
WebView *myWebView = [[WebView alloc] initWithFrame:frame
frameName:@"Test Frame" groupName:nil];
[[myWebView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL
URLWithString:@"http://nytimes.com";]]];
NSView *printView = [[[myWebView mainFrame] frameView] documentView];


[printInfo setVerticallyCentered:NO];
[printInfo setHorizontalPagination:NSFitPagination];

NSPrintOperation *printOperation = [NSPrintOperation
printOperationWithView:printView];
[printOperation runOperation];
------------------


If I can't get this to work, I'll go to a NIB file, but I'd really
like to avoid that if possible...
Thanks in advance....
_______________________________________________

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

  • Follow-Ups:
    • Re: Creating WebView in code
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Re: My first framework - but no 'Header'
  • Next by Date: How to get tiff from clipboard and convert to bmp?
  • Previous by thread: Re: My first framework - but no 'Header'
  • Next by thread: Re: Creating WebView in code
  • Index(es):
    • Date
    • Thread