trying to redraw an NSPopupButtonCell (has text on text overlay)
trying to redraw an NSPopupButtonCell (has text on text overlay)
- Subject: trying to redraw an NSPopupButtonCell (has text on text overlay)
- From: "William Zumwalt" <email@hidden>
- Date: Mon, 4 Jun 2007 21:21:04 -0500
I've overridden mouseDown in my NSTableViewHeader class which contains
NSPopUpButtonCell's.
The problem is that, even though I can make the popupButtonCell
selection and catch it in this method, when I send the setTitle: msg
below, it just overlays the title on top of the previous title. So
then I figure I need to redraw it ... but calling display: or marking
it with setNeedsDisplay: doesn't clear up the data table's header cells.
- (void) mouseDown:(NSEvent *) event
{
NSPoint point = [event locationInWindow];
int column = [self columnAtPoint:[self convertPoint:point
fromView:nil]];
if (column >= 0) {
NSTableColumn *col = [[[self tableView] tableColumns]
objectAtIndex:column];
[[col headerCell] trackMouse:event
inRect:[self headerRectOfColumn:column]
ofView:self untilMouseUp:NO];
[[col headerCell] setTitle:[[[col headerCell]
selectedItem] title]];
} else {
[super mouseDown:event];
}
[self setNeedsDisplay:YES];
return;
}
I'm obviously doing something wrong here.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden