Re: my first custom view (problems)
Re: my first custom view (problems)
- Subject: Re: my first custom view (problems)
- From: publiclook <email@hidden>
- Date: Tue, 18 Mar 2003 19:16:04 -0500
The rectangle passed to -drawRect: is the rectangle in the view's own
coordinate system that needs to be redrawn. It can be any size
depending on how much redrawing is needed.
Perhaps you want NSDrawGroove([self bounds],[self bounds]);
I am also not sure that NSDrawGroove is still supported. It is a hold
over from NeXTstep and probably does not have the Aqua look.
On Tuesday, March 18, 2003, at 06:27 PM, Frank Fenn wrote:
Hi all,
I've started to play around with a simple custom view. I have an
interface with a text field and
right from it a custom view with the dimensions 310 x 150.
The only method I've implemented so far is:
-(void) drawRect:(NSRect)rect
{
NSLog(@"%f %f",rect.size.width,rect.size.height);
// draw border
NSDrawGroove(rect,rect);
}
When the window is created the border is drawn and the size reported
is 310 x 150. Now I enter
something in the text field and make the window inactive. Another
border is drawn in my custom
view with the dimensions 310 * 25 !!!??? What's going on here? 25 is
exactly the height of the
text field. If I add another text field below the first one and repeat
the procedure a border is drawn
on my custom view which matches exactly the lower edge of the second
text field. Any Ideas?
--
regards
Frank Fenn - Bright Light Software
_______________________________________________
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.
_______________________________________________
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.