Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Programmatic WebView



On Jun 7, 2004, at 7:42 PM, Brian Yamabe wrote:

I'm trying to write a unit test that needs access to a WebView.  Here's
the code I use to create and load a URL:

     NSRect webViewRect = NSMakeRect(0, 0, 10, 10);
     WebView *webView = [[WebView alloc] initWithFrame:webViewRect
frameName:@"frameName" groupName:@"groupName"];
	NSString *urlText = [NSString
stringWithString:@"http://www.apple.com";];
     NSLog(@"loading URL %@", urlText);
     [[webView mainFrame] loadRequest:[NSURLRequest
requestWithURL:[NSURL URLWithString:urlText]]];
     float progress = [webView estimatedProgress];
     NSLog(@"%f download", progress);

The code compiles and executes, but the progress of the loading never
gets past 0.1.  Even if I put in a loop, the progress still says 0.1.
Any thoughts as why the progress is stalled, or how I can use WebView
in a non-GUI?

You don't need a GUI, but you do need a run loop.

There's some run loop information at <http://developer.apple.com/documentation/Cocoa/Conceptual/ InputControl/Tasks/runningloops.html> and elsewhere in the Cocoa and CoreFoundation documentation.

    -- Darin
_______________________________________________
webkitsdk-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webkitsdk-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Programmatic WebView (From: Brian Yamabe <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.