ListCtrl new appearance (4.0.7 to 4.1.x migration)

Hallo,

I’ve noticed, that the ListCtrl has a slightly different appearance. In the 4.0.7 release, the vertical borders stopped at the last item of the list. In the 4.1.x release, the borders go all the way down to the end of the list.

Is there any way to enable the old behavior?

Minimal Code Example:

#!/usr/bin/env python
import wx

app = wx.App()

frame = wx.Frame(None, title='Simple application')

lw = wx.ListCtrl(frame, style=wx.LC_REPORT|wx.SUNKEN_BORDER|wx.LC_HRULES|wx.LC_VRULES)
lw.AppendColumn("A")
lw.AppendColumn("B")
lw.Append(("a1", "b1"))
lw.Append(("a2", "b2"))

frame.Show()

app.MainLoop()

Screenshot (can only put the new screenshot, but the vertical borders should stop after the a2/b2 row):

New:

Here is the screenshot with the 4.0.7 release (this is the desired result):

Hi,

This seems to be OS specific. When I run your code on linux with wxPython 4.1.1 the vertical borders stop at the last horizontal border, similar to your 4.0.7 example.

Have you tried UltimateListCtrl? Does it do what you want?

import wx
from wx.lib.agw import ultimatelistctrl as ULC

app = wx.App()

frame = wx.Frame(None, title='Simple application')
agw_style = wx.LC_HRULES | wx.LC_REPORT | wx.LC_VRULES
lw = ULC.UltimateListCtrl(frame, wx.ID_ANY, agwStyle=agw_style)
lw.InsertColumn(0, "A")
lw.InsertColumn(1, "B")
lw.Append(("a1", "b1"))
lw.Append(("a2", "b2"))

frame.Show()

app.MainLoop()

That seems to fix the vertical borders, but I get some weird artifact on the headers:

The appearance of the headers on linux is very different. It uses a 3D look, both in the ListCtrl and the UltimateListCtrl.

However, in the UltimateListCtrl it also has a slightly odd appearance after the last header:

Screenshot at 2022-02-15 20-01-19

Edit: I’ve just remembered that on linux the appearance of the headers is influenced by the the theme that is being used. My default theme is what is causing the 3D look. Some of the other themes make the headers look very similar to your screen capture, including the artefacts.