Re: Drawing views
Re: Drawing views
- Subject: Re: Drawing views
- From: Joshua Pennington <email@hidden>
- Date: Thu, 1 Jun 2006 12:25:01 -0500
- Resent-date: Thu, 1 Jun 2006 12:25:15 -0500
- Resent-from: Joshua Pennington <email@hidden>
- Resent-message-id: <email@hidden>
- Resent-to: email@hidden
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@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden