Is it me or is it a bug.
I have a listbox with two events, CellBackgroundPaint and CellTextPaint.
The listbox has 3 rows and 2 columns.
Event CellBackgroundPaint and CellTextPaint both contains:
system.DebugLog("Row: “+str(row)+” - "+"Column: "+str(column))
A button fires the command:
The above InvalidateCell command should only update row 1 and column 1, but unfortunately all rows and columns are effected as you can see in the debug log:
debug: Row: 0 - Column: 0
debug: Row: 0 - Column: 1
debug: Row: 1 - Column: 0
debug: Row: 1 - Column: 1
debug: Row: 2 - Column: 0
debug: Row: 2 - Column: 1
Is this a bug or am I doing something wrong?
It may be a bug. Or maybe a non used chance for an optimization.
Digging at the listbox a bit deeper, it looks like there are more issues with refreshing.
I experienced the same problem.
InvalidateCell does not invalidate just one cell, but all cells in all rows.
Is there any workaround?
I think it’s a missing optimization
I’ve been doing some experimenting with the ListBox and InvalidateCell as well lately, because of Cocoa performance issues (see the other recent thread, really bad how sluggish it behaves under Cocoa, borderline unusable). As I have experimented with various workarounds, I am starting to think it refreshes the grid many, many times when it shouldn’t. I’ve put counters in the CellBackgroundPaint and the CellTextPaint events and often moving from one cell to another via the mouse, or making a call RowFromXY will call the paint events hundreds of times. I’m still digging to find the issue, but I think what you are seeing is probably related to the cause.