Hi,

I'm designing a tiny NSActionCell subclass which doesn't do anything else
that manage a couple (5) NSTextFieldCells next to each other. My problem is
that the NSTextFieldCells draw over the bounds of the NSRect I'm giving them
to draw in, resulting in clashes.

My code looks like this:

@implementation MyCell
- (void) drawWithFrame: (NSRect) aFrame
                inView: (NSView *) controlView
{
  NSRect f;

  // draw fromField
  NSCopyMemoryPages(&aFrame, &f, sizeof(NSRect));
  f.origin.x = 55;
  f.size.width = 150;
  // this draws much more than 150 pixels of width!
  [fromField drawWithFrame: f inView: controlView];

  // similar for the other fields...
}

The funny thing is if I set the NSTextField to bordered, the border is drawn
correctly (i.e. 150 pixels of width in the above example), but the string
leaks over.

Is this a known bug of NSTextFieldCell, or am I doing something wrong? Does
anyone have some example code illustrating how this is supposed to work?

Regards,
                --Bj�rn

Reply via email to