[WASTE-list] WEDisposeView

Richard Laws manistyman at yahoo.com
Wed Apr 25 14:45:11 EDT 2007


Thanks, Marco.

I'm experimenting, so I made some assumptions about
WEViewReference. I did, in fact, create a WEReference
with WENew() and void view and dest rects, then loaded
it into WENewView() with defined rectangles. I've
been accessing the WEReference with WEGetViewOwner().
As I say, it's experimental and works, but perhaps
pointless in my case. I'm creating a WASTE text
HIViewRef embedded in a scrollable HIViewRef, and the
use of the word "view" got me intrigued.

There appears to be no way that I can create the
WEViewReference with a CGContextRef because of the
context passed in with the kEventControlDraw handler.

Thanks again for the clarification.

Richard


--- Marco Piovanelli <marco.piovanelli at pobox.com>
wrote:


> On Wed, 25 Apr 2007 08:42:59 -0700,

> Richard Laws (manistyman at yahoo.com) wrote:

>

>

> >Hello:

> >

> >Am I right in assuming that WEDisposeView()

> disposes

> >of the WEReference previously passed in to

> >WENewView()?

>

> WEDisposeView disposes (or more exactly, it

> decrements the

> reference count) of a WEViewReference that may have

> been

> created by WENewView() or WENewViewWithCGContext().

>

> OTOH, a WEReference (a reference to a controller

> object)

> can only be released by WEDispose().

>

> A controller (WEReference) may have zero, one or

> more

> views (WEViewReferences) attached to it. Views can

> be

> bound to either a Quickdraw port or a Core Graphics

> context.

>

> There are three ways to create a view:

>

> 1. A view is implicitly created by WENew() when

> its

> controller is created, unless you pass NULL

> in

> the destRect/viewRect parameters. This view

> is

> always QD-bound.

>

> 2. WENewView() creates a new QD-bound view and

> attaches

> it to the specified controller.

>

> 3. WENewViewWithCGContext() creates a new

> CG-bound

> view and attaches it to the specified

> controller.

>

> >I'm also wondering if there's any substantive

> advantage

> >to using WEViewReference at the moment.

>

> It depends on your needs. If you have a single-view

> controller

> in an application that still uses Quickdraw, you

> don't need to

> know about views. You just manipulate the

> controller (WEReference)

> and the view object will be handled transparently

> behind the

> scenes. OTOH, if you need multiple views per

> controller, or

> perhaps if you need to draw text into a PDF context,

> you need

> the new view APIs.

>

> HTH,

>

>

> -- marco

>

> --

> It's not the data universe only, it's human

> conversation.

> They want to turn it into a one-way flow that they

> have entirely

> monetized. I look at the collective human mind as a

> kind of

> ecosystem. They want to clear cut it. They want to

> go into the

> rainforest of human thought and mow the thing down.

>

>



__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


More information about the WASTE-list mailing list