This is not currently possible in wxPython.
If you compile from source you may try, as a temporary solution, to apply the following patch that I created: https://github.com/wxWidgets/wxWidgets/pull/1963
However, if you want a long term solution, you should wait until the API is finalized in wxWidgets version 3.2, hopefully before the end of the year. See the discussion at https://groups.google.com/g/wx-dev/c/QY965dseicg for more details about what form this might take when it is available.