Make sure that window decoration are visible

Vadim Zeitlin vadim at wxwindows.org
Fri Jun 1 06:44:27 PDT 2007


On Wed, 30 May 2007 16:20:32 +0200 Julien Pommier <julien.pommier at insa-toulouse.fr> wrote:

JP> My application is saving the position of its frame on exit, and tries to restore
JP> it on startup. My concern is that I have seen more than once this kind of
JP> program sometimes restoring their window at positions which are outside the
JP> screen (after a corruption of their saved preferences for example), so I'm
JP> wondering if there is an easy way in wx to make sure that the window is on
JP> screen (at least its title bar!) ?

 Use wxDisplay::GetFromPoint() or GetFromWindow(). If they return -1, then
the point (or the centre of the window) is not visible.

 Regards,
VZ

-- 
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/





More information about the wx-users mailing list