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: browser in screensaver



In your initWithFrame code you need to add the WebView as a subview of the ScreenSaverView, like so.

    [self addSubview:web];

You will not need to override drawRect, you should do your loadRequest in the initWithFrame also.

This should get you on the right track.

— Timothy Hatcher


On Oct 22, 2005, at 7:58 AM, loop wrote:

- (id)initWithFrame:(NSRect)frame isPreview:(BOOL)isPreview

{

    self = [super initWithFrame:frame isPreview:isPreview];

    if (self) {

        [self setAnimationTimeInterval:-1];

    }


    web = [[WebView alloc] initWithFrame:frame];

    [web setHostWindow:[self window]];


    return self;

}



- (void)drawRect:(NSRect)rect

{

    [[web mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.apple.com"]]];

}



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webkitsdk-dev/email@hidden

This email sent to email@hidden

References: 
 >browser in screensaver (From: loop <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.