Re: Getting IB_DESIGNABLE to work properly


Graham Cox
 

On 5 Mar 2018, at 9:57 am, Quincey Morris <quinceymorris@rivergatesoftware.com> wrote:

On Mar 4, 2018, at 14:31 , Quincey Morris <quinceymorris@rivergatesoftware.com> wrote:

you can compensate for that
Works, too!

- (void) prepareForInterfaceBuilder
{
mIsInterfaceBuilder = YES;
}

- (void) drawRect:(NSRect) dirtyRect
{


if (mIsInterfaceBuilder)
{
for (GCDigitView* subview in self.subviews)
{
if (subview.isHidden || ![subview isKindOfClass: [GCDigitView class]])
continue;

[subview drawRect: dirtyRect offset: YES];
}
}
}
- (void) drawRect:(NSRect) dirtyRect
{
[self drawRect: dirtyRect offset: NO];
}

- (void) drawRect:(NSRect) dirtyRect offset: (BOOL) isOffset
{
NSRect dbr = [self highlightRectForMask:kGCBothHalvesHighlight];
if (isOffset)
dbr = NSOffsetRect (dbr, self.frame.origin.x, self.frame.origin.y);
Cool - I’ll give that a shot. Thanks!

—Graham

Join cocoa@apple-dev.groups.io to automatically receive all group messages.