Re: drawing into a hidden view

2010-05-16 Thread Seth Willits
On May 15, 2010, at 11:50 AM, Shane wrote: I have an application which swaps NSViews based on which segment of an NSSegmentedControl the user clicks on. There's one specific NSView in which I draw a graph using NSBezierPath's. This view is initialized once my application is started and always

drawing into a hidden view

2010-05-15 Thread Shane
Hi, I have an application which swaps NSViews based on which segment of an NSSegmentedControl the user clicks on. There's one specific NSView in which I draw a graph using NSBezierPath's. This view is initialized once my application is started and always exists, it's just not always the currently

Re: drawing into a hidden view

2010-05-15 Thread Kyle Sluder
On Sat, May 15, 2010 at 11:50 AM, Shane software.research.developm...@gmail.com wrote: I have nothing in my code that says if the view is not shown, don't draw into it. Anyone have ideas on what's happening? You need to dissociate drawing from data collection. Your view's implementation of

Re: drawing into a hidden view

2010-05-15 Thread Shane
You need to dissociate drawing from data collection. Your view's implementation of -drawRect: should simply draw whatever the current state is. It might be something as simple as this: - (void)drawRect:(NSRect)dirtyRect {  for (DataPoint *p in [modelObject dataPoints])    [self

Re: drawing into a hidden view

2010-05-15 Thread Kyle Sluder
On Sat, May 15, 2010 at 6:51 PM, Shane software.research.developm...@gmail.com wrote: But I have. My drawRect: is simply as follows. - (void) drawRect:(NSRect) rect {        NSRect bounds = [self bounds];        [[NSColor blackColor] setFill];        [NSBezierPath fillRect:bounds];