Re: Child and Parent windows have dysfunctional relationship?
Re: Child and Parent windows have dysfunctional relationship?
- Subject: Re: Child and Parent windows have dysfunctional relationship?
- From: Jeremy Dronfield <email@hidden>
- Date: Wed, 14 Jul 2004 22:52:57 +0100
On 14 Jul 2004, at 7:15 pm, Clark Cox wrote:
But stays attached how? and to what point in the parent window?
To the point at which it was originally attached, I would hope.
Imagine a child window in the dead center of it's parent. Which edge
of the parent window should the child window move relative to?
None of them. I assume it must have been placed dead centre for a
reason, so I guess it should move so that it stays dead centre.
I would imagine that since these questions cannot be answered for the
general case that it is left up to you to tell the child how to
behave.
For the general case, no, it isn't possible to stipulate a single
inflexible behaviour. However, I would imagine that a mature API would
offer some basic options. By default, I would say that the child
window's origin should maintain a constant position relative to the
nearest edge of the parent. Or, one might expect a method on NSWindow
like:
- (void)addChildWindow:(NSWindow *)childWin
ordered:(NSWindowOrderingMode)place tiedToEdge:(NSRectEdge)tiedEdge
with the option of passing NSNearestXEdge or whatever. With an
alternative:
- (void)addChildWindow:(NSWindow *)childWin
ordered:(NSWindowOrderingMode)place tiedToPoint:(NSPoint)tiedPoint
For more complex behaviour (such as keeping the child dead centred),
one might expect to have to work it out for oneself. I'm just
expressing surprise that, in an API where so much complex behaviour is
provided free, there's nothing to deal with keeping the child at a
fixed distance from the right-hand or bottom edge of the parent window
when the parent resizes. I'm so used to Cocoa's bounties, it startled
me a bit. Which is why I queried whether this was a bug or behaviour
yet to be implemented.
Regards,
-Jeremy
_______________________________________________
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.