I'm changing the insertion point size by overriding -(void)drawInsertionPointInRect:(NSRect)aRect color:(NSColor *)aColor turnedOn:(BOOL)flag
, But it doesn't handle the first blink (when you move the insertion point, it goes back to normal)
I managed to handle the first blink by overriding the private method - (void)_drawInsertionPointInRect:(NSRect)aRect color:(NSColor *)aColor
.
But this is not a solution for me since overriding the private method will result in being decline by App Store. I want the app to be in App Store. I see Apps like iAWriter and Writeroom have a custom insertion point and they are in App store.
Does anyone know how they managed to do this, or a better way rather than overriding the private method?
Thanks.
- (void)_drawInsertionPointInRect:(NSRect)aRect color:(NSColor *)aColor
{
aRect.size.width = 3.0;
[aColor set];
[NSBezierPath fillRect:aRect];
}
- (void)drawInsertionPointInRect:(NSRect)aRect color:(NSColor *)aColor turnedOn:(BOOL)flag
{
if(flag) {
aRect.size.width = 3.0;
[aColor set];
[NSBezierPath fillRect:aRect];
}
else {
[self setNeedsDisplayInRect:[self visibleRect] avoidAdditionalLayout:NO];
}
}