Skip navigation.
 
mlRe: Drawing views
FROM : Joshua Pennington
DATE : Thu Jun 01 19:25:01 2006

The NSRect you are sent in NSView:drawRect contains relative 
coordinates. It should automatically stay on the left-bottom when the 
window is resized. Try opening IB and putting a control at the bottom-
left, and then run the app. Resize the window and it should stay in 
the bottom-left.

Joshua

On Jun 1, 2006, at 11:25 AM, Livio wrote:

> I have a view in a normal window and want it to remain in the same
> position when resizing the window (i.e. fixed at left-bottom), but the
> rect I receive in the view's drawRect method is always at positive
> origin (I should have origin.y = -15 but have origin.y = 15).
>
> I subclassed the window's method windowWillResize to send a message to
> the view so that it can arrange its frame origin to reflect the new
> window size, but still doesn't work.
>
> The fact is that if I use that rect to draw the view, the view will
> move, and if I use the view's frame rect to draw it, the view will not
> be drawn completely.
>
> How can I do?
> Thanks,
> liivo.
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list      (<email_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>
> This email sent to <email_removed>

Related mailsAuthorDate
mlDrawing views Livio Jun 1, 18:25
mlRe: Drawing views Joshua Pennington Jun 1, 19:25
mlRe: Drawing views Livio Jun 2, 11:12
mlRe: Drawing views Erik Buck Jun 2, 20:16