Re: Best place to create CGLayers
Re: Best place to create CGLayers
- Subject: Re: Best place to create CGLayers
- From: Paul Sinclair <email@hidden>
- Date: Wed, 8 Jun 2005 14:26:22 -0700 (PDT)
I have something similar to that right now but it
seems like a hack rather than the design for NSViews.
awakeFromNib seemed like an ideal spot but it doesn't
work since the port isn't available yet. I just
assumed that there was a more elegant solution.
--- Aaron Zinman <email@hidden> wrote:
> Why not do something like
>
> BOOL init = FALSE;
>
> -(void) drawRect
> {
> if ( !init )
> {
> [self createCGLayers];
> init = TRUE;
> }
>
> [self doAnimation];
> }
>
> On Jun 8, 2005, at 3:52 PM, Paul Sinclair wrote:
>
> > I have overridden NSView and I want to create some
> > CGLayers for some animated drawing. I am calling:
> >
> > [[NSGraphicsContext currentContext] graphicsPort]
> >
> > ...to get the CGContextRef for the call to
> > CGLayerCreateWithContext().
> >
> > I can't call the graphicsPort method mentioned
> above
> > inside my NSView initWithFrame override since the
> > port/context isn't available yet. I don't want to
> > create my CGLayers in my NSView drawRect override.
> >
> > Where is the best place to create my CGLayers?
> When
> > is that context finally available (when will the
> > graphicsPort call not return nil)?
> >
> >
> >
> >
> > __________________________________
> > Discover Yahoo!
> > Use Yahoo! to plan a weekend, have fun online and
> more. Check it out!
> > http://discover.yahoo.com/
> > _______________________________________________
> > Do not post admin requests to the list. They will
> be ignored.
> > Cocoa-dev mailing list
> (email@hidden)
> > Help/Unsubscribe/Update your Subscription:
> >
>
>
> > 40media.mit.edu
> >
> > This email sent to email@hidden
> >
>
>
__________________________________
Discover Yahoo!
Have fun online with music videos, cool games, IM and more. Check it out!
http://discover.yahoo.com/online.html
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden