Layering NSViews -- why isn't this recommended?
Layering NSViews -- why isn't this recommended?
- Subject: Layering NSViews -- why isn't this recommended?
- From: "Michael P. Rogers" <email@hidden>
- Date: Wed, 6 Jun 2001 22:29:34 -0500
I've been trying to create a pile of cards that are offset -- so each
card is to the right and below the one beneath it (ala Eric's
Solitaire, which I believe used to ship with the Mac at one time).
My Cards are subclasses of NSImageView.
My plan is to
1) make a Card class (subclass of NSImageView)
2) place those Cards in a Window's contentView using a method in
NSView that sounded promising, addSubview:positioned:relativeTo:.
It seems to work, but the documentation has this dire warning:
"addSubview:positioned:relativeTo:, allows you to specify the
ordering of NSViews that may overlap (though laying out NSViews so
that they overlap isn't recommended)."
Does anybody know why this isn't recommended? And otherwise, how can
I accomplish this? In Java there's a JLayeredPane; is there any
equivalent in the Application Kit?
Thanks,
Michael
--
---------------------------------
Dr. Michael Rogers
e-mail: email@hidden
Phone: 217-424-6327
For information about Computer Science at Millikin University, visit
http://math.millikin.edu
For information about astronomy, check out
http://twincityamateurastronomers.org