NSView Issue- Drawing Hierarchy
NSView Issue- Drawing Hierarchy
- Subject: NSView Issue- Drawing Hierarchy
- From: "j.oie(mecha : himitsu)" <email@hidden>
- Date: Wed, 3 Jul 2002 19:34:14 -0500
Hoi.
I understand the sensibility of having a view draw all of its subviews.
However, it raises a thorny issue for me. I have a container view(its
own subclass of NSView) which holds alternately a dummy NSView(if
nothing needs to be displayed) and a view of a map(e.g., a castle in a
role-playing game). I would like the container view to facilitate
spiffy dissolves between maps- say, a closing-shutters effect. The
effect is easily attained with NSRectFill(), but here's the problem: An
NSView (or a subclass thereof) draws all of its subviews in the act of
drawing itself- after it draws itself! So the still-live map view will
cover the pretty dissolve rectangles with its own background. This is
undesirable. Is there any way around this idiosyncracy? I don't think
that it's the map view's job to dissolve itself, as there will later be
other dissolves(e.g., between the map and the menu, the map and a shop,
the map and a battle, &c)... it seems that the container view is the
best place to do the dissolving.
Further complicating the matter: I read today that it was considered
incorrect to put drawing code in a view that had subviews. Could this
be why? ^^:; Also, i read that the behaviours of overlapping views in
different view hierarchies were broken.
It seems sort of backwards to me to have a subview for an overlay, but
if that need be the case, I guess it's what I'll have to do- make a new
dissolve view and make it subview of the map view. If i do that,
however, will the subview retain its place in the view hierarchy? Or
will I have to generate a new subview or swap in the old one for each
map view? aggh, my head hurts...
^_^ But I'm sure I'm just missing something obvious and pleasant.
I may end up just having the map do its own dissolves.
-joie
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.