- 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() ) );