• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Multiple Overlapping SubViews?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Multiple Overlapping SubViews?
      • From: Jon Hull <email@hidden>
    • RE: Multiple Overlapping SubViews?
      • From: "Jonathan E. Jackel" <email@hidden>
  • Prev by Date: Adding items to the menu that appears when you right-click a file in the finder?
  • Next by Date: Re: Adding items to the menu that appears when you right-click a file in the finder?
  • Previous by thread: Re: Adding items to the menu that appears when you right-click a file in the finder?
  • Next by thread: Re: Multiple Overlapping SubViews?
  • Index(es):
    • Date
    • Thread