ListView Ownerdraw lazarus / 32-Linux ---------------------------------------------------------------------- dbannon · 2020-11-10 05:41 Hi Folks, I am trying to display some ListView contents with alternating row colours. So, I did - Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.ListView1DrawItem(Sender: TCustomListView; AItem: TListItem;              ARect: TRect; AState: TOwnerDrawState);var  aColor: TColor = $FFFFFF;   //Background color, pink = $EEEEFF. White is $FFFFFFbegin    // Note this only works for TListView if ViewStyle is vsReport and    // (obviously) we are in ownerdraw mode.    if Odd(AItem.Index) then        aColor := $EEEEFF;    ListView1.Canvas.Brush.Color := aColor;    ListView1.Canvas.FillRect(ARect);    ListView1.Canvas.TextRect(ARect, 2, ARect.Top+2, ListView1.Items[AItem.Index].Caption);end;            And, initially, it does exactly what I want. But if more data is added than can be seen, that is, you need to scroll down, it fails. The lines you expose when scrolling down do not contain their text, the background colour has been painted fine but text is missing until you give that line a 'nudge' with the mouse and then it gets painted.  If you then scroll up and down again, again the bottom lines will be missing their text. This only shows up as a problem with GTK2, with Qt5 and even GTK3, no sign of the problem.  Anyone suggest what I am doing wrong ? Davo ---------------------------------------------------------------------- dbannon · 2020-11-11 03:24 In case anyone is watching, this is a Trunk bug, probably likely to affect other, similar components too. Logged -   https://bugs.freepascal.org/view.php?id=38062 Davo