I am trying to dynamically update the titles of my table columns to show the 
current row that the mouse is over. I am using an NSTrackingArea to get the 
mouseEnter, mouseMove and mouseExit events and then calling the following 
method ( in my delegate ) to update the column titles. Unfortunately the column 
titles never change, though the printf statement shows that the method is being 
called correctly:

- (void)setColumnTitlesForMouseAt:(int)row{
        
        if(row == rowForColumnTitles)           // just to prevent unnecessary 
updating
                return;
        
        rowForColumnTitles = row;
        
        printf("\n %02x: ",row);
                
        NSTableColumn*  column;
        int                                     i;
        
        for(i = 1; i <= 16; ++i){
                column = [[itsTableView tableColumns] objectAtIndex:i]; 
                [[column headerCell] setStringValue:[NSString 
stringWithFormat:@"%02X",rowForColumnTitles]];
        }
        
        //[itsTableView displayIfNeeded];
        //[itsTableView setNeedsDisplay: YES];  
}

I've tried both the commented out methods at the end but no luck. Quartz Debug 
shows no updating in the header area either.

NOTE:  The column headers do update if I set a breakpoint at [itsTableView 
displayIfNeeded] or move the splitter that the table is in.

Thanks for any advice,

Peter Zegelin
www.fracturedsoftware.com

_______________________________________________

Cocoa-dev mailing list ([email protected])

Please 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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to