• 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: Nick Zitzmann <email@hidden>
  • Date: Fri, 2 Apr 2010 10:40:33 -0600

On Apr 1, 2010, at 8:17 PM, Jenny M wrote:

> 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).
> -----------------

That's most likely Flash Player at work, since it's been known to do this. To work around it, install a dummy SIGINT handler function that does nothing. See the signal man page for details.

> 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];

You must place the WebView in a window or else it won't render. It's a dumb but necessary requirement. So you'll need to also create an NSWindow and add the WebView as a subview of its content view, and that ought to work.

Nick Zitzmann
<http://www.chronosnet.com/>

_______________________________________________

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: Jenny M <email@hidden>
References: 
 >Re: Creating WebView in code (From: Jenny M <email@hidden>)

  • Prev by Date: Re: Alternative startup for application
  • Next by Date: Re: NSPredicate/NSExpression - can they solve this Core Data problem?
  • Previous by thread: Re: Creating WebView in code
  • Next by thread: Re: Creating WebView in code
  • Index(es):
    • Date
    • Thread