I do not think that this can be done so easily if the mouse is outside the main frame. However, you can always do the following:
1) Start the timer in your main frame and poll it every 50 milliseconds (or whatever suits you);
2) After you interrogate it in the OnTimer event handler, check the mouse position via wx.GetMousePosition () (this will be in the coordinates );
3) In the same OnTimer method, get the screen position of your frame through frame.GetScreenPosition ();
4) Compare the position of the mouse with the position of the frame (possibly using the calculation of the Euclidean distance or what suits you). Then you set the transparency of the frame accordingly to this distance (do not forget to leave it completely opaque if the mouse is inside the rectangle of the frame).
I did it just for fun, it shouldn't take more than 5 minutes.
Hope this helps.
Andrea.
source share