|CompositeTable: Modifying the content of a row [message #594729]
||Mon, 04 May 2009 14:27
| Rich Scott
Registered: July 2009
I would like to have row in a Composite table containing either a |
StyledText widget or a Canvas which is used to draw an image. I tried to
define the row as a Composite and then when a Row instance was used,
remove the old child of the Composite, add a new child of the proper type
and set the data for that new child. With this approach, the initial cells
display as desired, but table scrolling is broken. The scroll bar moves,
in small increments, in response to the mouse, but not scroll events are
fired, so the contents are not updated.
Within the row composite, the processing to set the new content (called
from the IRowContentProvider is as follows
1) remove old child from row Composite (call dispose on the old child)
2) create a new child widget based upon the data type as a child of the
If appears to be the process of removing the old child that is affecting
scrolling. If I comment the dispose out, scrolling works, I just get an
additional child widget everytime a row is reused.
Is there a better way to be approaching the problem of different types of
row content? Any suggestions about the cause?