How to control widgets layout?

I have placed first on the panel SpeedMeter widget. It updates position of the hand depending on the value. It seems it is always redrawn if new value to show comes.
Then I needed some simple text to place on this SpeedMeter, so I used StaticText. This works perfect on windows machine with wxPython - StaticText stays on top so it is always visible.

But when I run this code on RaspberryPi (also wxPython installed the same version) the StaticText is rewritten so it “disappears”.

Is there any way as to tell wxPython to keep StaticText on top over the SpeedMeter widget?

Overlapping sibling widgets is one of the areas where wxWidgets does not define the behavior, because each platform handles it differently, and sometimes differently on the same platform depending on the widget that is used.

What you can do instead is to derive your own class from SpeedMeter and override the methods that are drawing the SpeedMeter and add drawing of the text you want to display.

Or you can position your static text such that it doesn’t overlap with the meter.