TreeCtrl on macOS in Dark Mode

I’ve recently discovered that my wxPython application doesn’t work properly on macOS in Dark mode.

For most of my forms, removing the self.SetBackgroundColour() specification has solved the problem. This makes sense to me, as Dark mode was changing text color from black to white, but the SetBackgroundColour() command was not responsive to OS Light/Dark mode.

However, I have a wxTreeCtrl that is central to navigating through hierarchical data, and in Dark mode on macOS, you cannot see the “buttons” that expand and collapse the tree nodes. You can see this issue in the wxPython Demo for the TreeCtrl. Because of the nature of the data in my app, the presence or absence of those “buttons” is crucial to fully navigating through the data.

At the moment, I detect the use of Dark mode on macOS and tell the user to change to Light mode. This is obviously not the elegant solution I would like for my application. Does anyone have a better idea how to solve this problem?

Thanks in advance,
David