X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0c39421228d4a84c8d0f9b61b0428c0b0302efbe..21b6ad64da0993887ff33f7255f0939c55e2d4b8:/src/gtk1/frame.cpp diff --git a/src/gtk1/frame.cpp b/src/gtk1/frame.cpp index 65ac5783e4..63af2106f8 100644 --- a/src/gtk1/frame.cpp +++ b/src/gtk1/frame.cpp @@ -1231,9 +1231,14 @@ void wxFrameGTK::Iconize( bool iconize ) { if (iconize) { - XIconifyWindow( GDK_WINDOW_XDISPLAY( m_widget->window ), - GDK_WINDOW_XWINDOW( m_widget->window ), - DefaultScreen( GDK_DISPLAY() ) ); + GdkWindow *window = m_widget->window; + + // you should do it later, for example from OnCreate() handler + wxCHECK_RET( window, _T("frame not created yet - can't iconize") ); + + XIconifyWindow( GDK_WINDOW_XDISPLAY( window ), + GDK_WINDOW_XWINDOW( window ), + DefaultScreen( GDK_DISPLAY() ) ); } }