]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/frame.cpp
Corrected imaglist addition
[wxWidgets.git] / src / gtk1 / frame.cpp
index ccb8237a04e672623bfdc2e28516087e92830f67..63af2106f811e16b92541ed3e1365c52797872a7 100644 (file)
@@ -23,7 +23,8 @@
 #define XIconifyWindow XICONIFYWINDOW
 #endif
 
 #define XIconifyWindow XICONIFYWINDOW
 #endif
 
-#include "wx/frame.h"
+#include "wx/defs.h"
+
 #include "wx/dialog.h"
 #include "wx/control.h"
 #include "wx/app.h"
 #include "wx/dialog.h"
 #include "wx/control.h"
 #include "wx/app.h"
@@ -1230,9 +1231,14 @@ void wxFrameGTK::Iconize( bool iconize )
 {
    if (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() ) );
    }
 }
 
    }
 }
 
@@ -1248,15 +1254,5 @@ void wxFrameGTK::SetIconizeState(bool iconize)
         m_isIconized = iconize;
         (void)SendIconizeEvent(iconize);
     }
         m_isIconized = iconize;
         (void)SendIconizeEvent(iconize);
     }
-    else
-    {
-        // this is not supposed to happen if we're called only from
-        // gtk_frame_(un)map_callback!
-        
-        // RR: I don't understand this test. Upon startup, the frame is
-        //     not iconized by default, it has just not been created
-        //     yet.
-        ///wxFAIL_MSG( _T("unexpected call to SendIconizeEvent ignored") );
-    }
 }
 
 }