Skip navigation.
 
mlText color of dragged rows in NSTableView
FROM : Saratchandra Kongara
DATE : Fri Nov 22 17:02:29 2002

Hello,
I am working on adding Drag N Drop support in my application. I have an
outline view and a table view. I like to drag rows in my table view and
drop them on to my outline view items. I have a little problem with my
implementation, the text color of the dragged rows (in the clipping) is
white sometimes and is barely visible. This behavior is random. The
text color keeps changing between black and white randomly. Here is the
code.

- (BOOL)tableView:(NSTableView *)tv writeRows:(NSArray *)rows
toPasteboard:(NSPasteboard *)pboard {
    NSMutableArray *rowArray = [[NSMutableArray alloc] init];
    NSEnumerator *enumerator = [rows objectEnumerator];
    id object;

    while(object = [enumerator nextObject]) {
        int rowNumber = [object intValue];
        [rowArray addObject:[[self tableDataSource]
objectAtIndex:rowNumber]];
    }
    NSData *data = [NSArchiver archivedDataWithRootObject:rowArray];
    [pboard declareTypes: [NSArray arrayWithObjects:@"table_item", nil]
owner:self];
    [pboard setData:data forType:@"table_item"];
    [rowArray release];
    return YES;
}

Any suggestions? Thanks.

Regards
Sarat
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
No related mails found.