I am trying to implement a custom tooltip control that paints an area for the text during the containing panel’s EVT_PAINT handler. And I would like the tooltip to appear on top of the other controls in the panel. However, as you can see by my example (below), there is a wx.StaticText control that remains on top of the tooltip after it is painted.
How can I make the tooltip draw on top of the wx.StaticText control?
I would start by adding the Widget Inspector to your code and watching the event list… I think your event order just needs re-arranged (you should probably handle this in the Frame’s OnPaint, maybe… not sure how you would ensure your painting is the last event to happen.
···
On Wednesday, December 3, 2014 1:59:11 PM UTC-8, geodoug wrote:
Hello,
I am trying to implement a custom tooltip control that paints an area for the text during the containing panel’s EVT_PAINT handler. And I would like the tooltip to appear on top of the other controls in the panel. However, as you can see by my example (below), there is a wx.StaticText control that remains on top of the tooltip after it is painted.
How can I make the tooltip draw on top of the wx.StaticText control?
In looking at the event order, I figured out that the children objects of the panel (i.e. the StaticText and ToolTip objects) were being drawn after the Panel itself (which makes complete sense). I took your advice and am drawing directly to the Frame instead, which fixed my layout issue.