TableView slow to redraw
TableView slow to redraw
- Subject: TableView slow to redraw
- From: Doug Adams <email@hidden>
- Date: Tue, 07 Jun 2011 16:32:49 -0400
I'm using tableView_willDisplayCell_forTableColumn_row to color the text in all cells of the rows of a table (eight columns) where a checkbox on that row is checked. Works great. Except that as the TableView is resized larger it takes longer to redraw the table. Perhaps obviously. But I mean it takes noticably longer--two seconds or so if the window containing the table is full screen. I can almost live with that. But the annoying thing is that the window needs to redraw quite often, such as when re-sorting by column, or when a utility window is opened or closed over it, or when the app becomes/resigns active, and so on.
The code for the method looks like this:
on tableView_willDisplayCell_forTableColumn_row_(aTableView, aCell, aColumn, aRow)
if (aColumn's identifier()) as text is not "tCheckbox" then
if (arrayController's arrangedObjects())'s objectAtIndex_(aRow)'s tCheckbox is true then
if ((aCell's isHighlighted()) as boolean is true) then
aCell's setTextColor_(whiteColor)
else
aCell's setTextColor_(grayColor)
end if
else
aCell's setTextColor_(blackColor)
end if
end if
end tableView_willDisplayCell_forTableColumn_row_
Is redrawing slower because things are happening asynchronously with ASOC? Or something like that? Is there anything I can do to liven things up? I like the text-coloring effect, but I'm prepared to lose it if I can't keep it speedy.
Doug
--
dougscripts.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden