Re: converting application to cocoa
Re: converting application to cocoa
- Subject: Re: converting application to cocoa
- From: Eric Peyton <email@hidden>
- Date: Wed, 4 Jul 2001 23:16:10 -0500
Just use an NSQuickDraw view in your screensaver and draw quickdraw
in to your screensaver.
The example source I have on
http://www.epicware.com/macosxsavers.html can be sort of a guide.
Instead of the NSOpenGLView that I use to draw, use an
NSQuickDrawView and instantiate it and draw in to it.
I would imagine that your ScreenSaverView subclass might contain
code something like this ...
(this is all off the top of my head - YMMV).
QuickDrawSample.h
@interface QuickDrawSample : ScreenSaverView
{
NSQuickDrawView *_qdview;
}
@end
QuickDrawSample.m
@implementation QuickDrawSample
- (id)initWithFrame:(NSRect)frameRect isPreview:(BOOL)preview
{
self = [super initWithFrame:frameRect isPreview:preview];
if (self) {
// add a view the same size and frame as myself, and make
it my subview
_qdview = [[[NSQuickDrawView alloc]
initWithFrame:frameRect] autorelease];
[self addSubview:_view];
}
return self;
}
- (void)dealloc
{
[_qdview removeFromSuperview];
[super dealloc];
}
- (void)animateOneFrame
{
void *port = [_qdview qdport];
// do quickdraw code here.
return;
}
- (BOOL)hasConfigureSheet { return NO; }
- (NSWindow*)configureSheet {
return nil;
}
@end
Eric
On Wednesday, July 4, 2001, at 10:50 PM, Annie Felix wrote:
I have got an uncarbonised version of a program
which I am trying to develop into a cocoa application.
It makes use of quickdraw to draw on to the window.It
is an screen saver application.What is it that I
should use in place of quick draw. Is it the openGL
framework? I have gone through an example app that
uses screensaver framework for developing screensaver
application.But as the present application uses quick
draw I don't have an idea of how to proceed.
Please give me some suggestion of how to proceed...
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev