Re: UI elements in custom view mess up drawing

2008-10-14 Thread Benjamin Stiglitz
When I turn off the progress indicator however, or when I update the string value of the text field, the drawing from the drawRect method above is drawn offset from its origin, instead drawing at the origin of either of the subviews, resulting in spurious lines being drawn where there

UI elements in custom view mess up drawing

2008-10-14 Thread Antonio Nunes
Hi, I have a custom view that draws half a frame and a gradient: - (void)drawRect:(NSRect)rect { // This results in darker separator line at left side. [[NSColor colorWithCalibratedWhite:0.18 alpha:1.0] set]; NSRectFill(NSMakeRect(NSMinX(rect), NSMinY(rect), 1,

Re: UI elements in custom view mess up drawing

2008-10-14 Thread Graham Cox
On 15 Oct 2008, at 12:38 am, Antonio Nunes wrote: As you can see from the image it looks like the view first draws itself correctly, then gets drawn for each of the other subviews, with its origin offset to match the origin of the subview in question. I don't understand why this happens.

Re: UI elements in custom view mess up drawing

2008-10-14 Thread Antonio Nunes
On 14 Oct 2008, at 14:43, Benjamin Stiglitz wrote: The rect passed to -[NSView drawRect:] is the dirty rect of the view, not the bounds of the view. The changing subviews are dirtying your view and then you're drawing as if that changed area was your complete frame. Try replacing your use