]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/frame.cpp
Corrected imaglist addition
[wxWidgets.git] / src / gtk1 / frame.cpp
index 65ac5783e4a3580f6e1b48c36df5b9d1e7cfe0fa..63af2106f811e16b92541ed3e1365c52797872a7 100644 (file)
@@ -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() ) );
    }
 }