• 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
How to anchor a child-window to its parent top-right (or other point) while parent resizes.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to anchor a child-window to its parent top-right (or other point) while parent resizes.


  • Subject: How to anchor a child-window to its parent top-right (or other point) while parent resizes.
  • From: Motti Shneor <email@hidden>
  • Date: Sun, 22 Jul 2012 14:34:03 +0300

Hi.

This seems a real newbie question, but the solutions I found seem too complicated for my task.

I have a non-NSPopover pop-over info window (can't use NSPopOver for many reasons).

This "popover like" is just a window that draws itself  "anchored" to some point in the parent window's coordinate system. Being a child-window of its parent, it also moves with it, as expected.

When parent window is resized, the popover loses its anchor point, because child-windows don't normally move when their parent resizes (no matter which side of the parent window is changing).

That behavior is a bit weird, because when movement is synchronized, one may guess that some point in the child window always moves with some other point in the parent window, or at least with some origin point (top-left, bottom-right, etc.) of the parent. None of this  happens.

I could fix this by moving my child-window in the "windowWillResize" or windowDidResize" delegate of the parent, but it is not easy to know exactly what happened (how did the anchor point on the parent, moved in screen-coordinates) and so move the child-window.

Any simpler ideas for such implementation?

Thanks.

Motti Shneor
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: How to anchor a child-window to its parent top-right (or other point) while parent resizes.
      • From: Keary Suska <email@hidden>
  • Prev by Date: Re: 10.7 Full-Screen transition animation corrupts my UI - how to avoid?
  • Next by Date: Re: 10.7 Full-Screen transition animation corrupts my UI - how to avoid?
  • Previous by thread: Where do you specify the string that explains why your app wants push notifications?
  • Next by thread: Re: How to anchor a child-window to its parent top-right (or other point) while parent resizes.
  • Index(es):
    • Date
    • Thread