• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
trying to redraw an NSPopupButtonCell (has text on text overlay)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: [CoreData] Background Insertion
  • Next by Date: Re: [CoreData] Background Insertion
  • Previous by thread: Re: Open new document in first (empty) window
  • Next by thread: reading selectedItem from within dataCellForRow?
  • Index(es):
    • Date
    • Thread