Mailing Lists: Apple Mailing Lists

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

browser in screensaver



hello everyone.

im new to cocoa and objc. and as you expect i have a problem with the webkit. i want build a screensaver that loads a html site. i already got it work to display an image but i dont know how to display the WebView Object.
this is my code i have;


- (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";]]];
}


till now the screen just stays white and dont display anything. the problem is that in all the examples that i found on the net they work with nib files and have there the WebView already on the screen. how do i specify on which view the WebView should draw? i already tried to call [web drawRect:rect] in the drawRect to delegate. same white background.
do i have to delegate some loading methodes to manually execute the drawing?
im also not sure if i have to set the host window or not.


thanks a lot for some infos or code snippets!


-- [beep]

loop : michael heimann
multimedia developer : nothing from outer space
email@hidden : www.nothing.ch

fon +41 (0) 31 384 10 12
fax +41 (0) 31 384 10 40
cel +41 (0) 79 542 33 65
_______________________________________________
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


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.