I seem to be missing something, and it's probably something quite obvious.
 In the initialization to an NSView subclass window, I do the following:

- (void) drawRect:(NSRect)dirtyRect
{
     [StepWindow DrawStepArea];
}

DrawStepArea is a simple function that draws some lines on the screen-
here's a condensed version:

+ (void) DrawStepArea
{
   CGRect stepsBox;

  CGContextRef stepsContext = [[NSGraphicsContext currentContext]
graphicsPort];
  CGContextSetLineWidth(stepsContext, 1.0);
  stepsBox = CGRectMake(0, 0, 100, 100);
  CGContextBeginPath (stepsContext);
  CGContextSetRGBStrokeColor(stepsContext, 0, 0, 0, 1);
  CGContextAddRect(stepsContext, stepsBox);
  CGContextFillPath(stepsContext);
  CGContextDrawPath (stepsContext, kCGPathStroke);
}

It works perfectly when the window is first initialized.  However, when I
call DrawStepArea later nothing gets drawn.  I'm calling from another class,
but everything about the call works fine including access to variables in
the StepWindow class.

Any idea what I'm missing, or on what to look for to figure this out?  Many
thanks for any suggestions.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to