Re: NSView drawing problem
Re: NSView drawing problem
- Subject: Re: NSView drawing problem
- From: David Rio Vierra <email@hidden>
- Date: Sat, 21 Dec 2002 01:35:45 -1000
Your approach to drawing seems a bit off. The usual way of drawing
into a view is actually by implementing an NSView subclass which does
the drawing in its -drawRect: method. Once this method is implemented,
existing NSView code will call it at the appropriate time in order to
draw your view. Keep in mind that in -drawRect:, focus has already
been locked on the view and you need neither lock or unlock your view.
- Rio
On Saturday, December 21, 2002, at 12:50 AM, Thilo Ettelt wrote:
Hi, I have a problem with drawing in an NSView. The code loads a NIB
file in its -init method and has another method for drawing -draw. The
thing loads a custom shaped window. When I call the -draw method from
the -init method it will draw something in the NSView (in that window)
correctly but when I fire the -draw method from -awakeFromNib it won't
work. The method is actually called but it doesn't draw anything or it
at least it doesn't display. I am using lockFocus/unlockFocus and then
in between -drawAtPoint an image using NSCompositeSourceOver and
fraction 1.0 to draw my stuff.
Do you have an idea what could be going wrong here? Thanks in advance.
Cheers, Thilo
_______________________________________________
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.