listtest.cpp:m_listCtrl->Bind(wxEVT_SIZE, [this](wxSizeEvent& aEvt) { const int width = std::max(m_listCtrl->GetClientSize().GetWidth() - 2, 20); m_listCtrl->SetColumnWidth(0, width); aEvt.Skip(); });
https://github.com/user-attachments/assets/c8e8eff0-f9b1-4dcd-a987-2c0595b6ca91
KiCad report: https://gitlab.com/kicad/code/kicad/-/work_items/23986
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Thanks, I can see this, even under Windows 10. Will look.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
This is nasty because it looks like a native LISTVIEW bug, i.e. while I didn't try doing it yet, I'm almost sure it could be reproduced just using Win32 API because I still see it even when removing our wxEVT_PAINT handler completely, resizing the column while in WM_SIZE handler seems to break some internal control logic for determining the dirty region.
Also, I can get rid of it by not enabling LVS_EX_DOUBLEBUFFER on the control, but this results in display glitches when resizing, just as indicated by the comment, so this is not a solution either.
However, I can propose the workaround: don't resize the columns from wxEVT_SIZE handler itself, but a bit later, i.e. do this:
m_listCtrl->Bind(wxEVT_SIZE, [this](wxSizeEvent& aEvt) { m_listCtrl->CallAfter([this] {
const int width = std::max(m_listCtrl->GetClientSize().GetWidth() - 2, 20); m_listCtrl->SetColumnWidth(0
, width);
});
aEvt.Skip();
});instead of what you did. In principle, we could even do it ourselves from inside SetColumnWidth() but I don't know if it's worth it, maybe just documenting this as wxMSW limitation with this workaround would be enough?
Anyhow, the real question is whether the workaround also works for KiCad and not just the example?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()