/* * AppController.j * CPWebViewTest * * Created by Alexander Ljungberg on March 4, 2011. * Copyright 2011, Alexander Ljungberg All rights reserved. */ @import @implementation AppController : CPObject { CPWindow theWindow; //this "outlet" is connected automatically by the Cib CPWebView webView1; CPWebView webView2; CPWebView webView3; CPWebView webView4; CPWebView webView5; CPWebView webView6; } - (void)applicationDidFinishLaunching:(CPNotification)aNotification { [webView1 setScrollMode:CPWebViewScrollAuto]; [webView1 loadHTMLString:""]; [webView2 setScrollMode:CPWebViewScrollNative]; [webView2 loadHTMLString:""]; [webView3 setScrollMode:CPWebViewScrollAuto]; [webView3 setMainFrameURL:[[CPBundle mainBundle] pathForResource:"hello_world.html"]]; [webView4 setScrollMode:CPWebViewScrollNative]; [webView4 setMainFrameURL:[[CPBundle mainBundle] pathForResource:"hello_world.html"]]; /* XXX If this program is run from file:// in Safari, it will actually have SOP access, disturbing test #5 and #6. A simple way to run this test is to change the current directory to the root of the test and executing: python -m "SimpleHTTPServer" */ if (document.location.href.indexOf('file://') == 0) alert("This test should be run from http://, not file:// in order to properly enable SOP testing."); [webView5 setScrollMode:CPWebViewScrollAuto]; [webView5 setMainFrameURL:"http://www.cappuccino.org"]; [webView6 setScrollMode:CPWebViewScrollAppKit]; [webView6 setMainFrameURL:"http://www.cappuccino.org"]; } - (void)awakeFromCib { // This is called when the cib is done loading. // You can implement this method on any object instantiated from a Cib. // It's a useful hook for setting up current UI values, and other things. // In this case, we want the window from Cib to become our full browser window [theWindow setFullBridge:YES]; } @end