Multiple Overlapping SubViews?
Multiple Overlapping SubViews?
- Subject: Multiple Overlapping SubViews?
- From: John Rieffel <email@hidden>
- Date: Mon, 15 Dec 2003 12:56:01 -0500
Is there a way for a window's content view to have multiple overlapping
subviews - i.e. subviews that occupy the same space?
I've tried to do this by creating two NSView instances with the same
frame (calling initWithFrame: with the same NSRect for each), and then
adding each view as a subview of the window's contentView. Alas, only
the last view to be added as a subview in that rect is ever displayed.
That is, if I do:
[[myWindow contentView] addSubview:mySubView1];
[[myWindow contentView] addSubview:mySubView2];
then mySubView2 will be displayed, but not mySubview1. If I add
subView2 first, then only mySubView1 is displayed.
The only workaround I've found is to create multiple separate _windows_ for each
view, making each view a subview of its respective window. This is,
however, extremely cumbersome, and I can't imagine that it's the proper
way to do things.
Thanks,
jr
_______________________________________________
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.