[WASTE-list] WEDisposeView

Marco Piovanelli marco.piovanelli at pobox.com
Wed Apr 25 13:45:47 EDT 2007


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.



More information about the WASTE-list mailing list