]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/dialog.cpp
Small correction to list ctrl and default button size.
[wxWidgets.git] / src / gtk / dialog.cpp
index ee60f258f2873bb61975b7746d2b90f91e9eb5e6..987c3b9c343ece46f657a7bde8b8aad423df2349 100644 (file)
@@ -96,7 +96,13 @@ static gint gtk_dialog_configure_callback( GtkWidget *WXUNUSED(widget), GdkEvent
 static gint 
 gtk_dialog_realized_callback( GtkWidget *widget, wxDialog *win )
 {
-    if (g_isIdle) wxapp_install_idle_handler();
+    if (g_isIdle) 
+        wxapp_install_idle_handler();
+
+    /* I haven''t been able to set the position of
+       the dialog before it is shown, so I set the
+       position in "realize" and "map" */
+    gtk_widget_set_uposition( widget, win->m_x, win->m_y );
 
     /* reset the icon */
     if (win->m_icon != wxNullIcon)
@@ -116,8 +122,12 @@ gtk_dialog_realized_callback( GtkWidget *widget, wxDialog *win )
 static gint 
 gtk_dialog_map_callback( GtkWidget *widget, wxDialog *win )
 {
+    if (g_isIdle) 
+        wxapp_install_idle_handler();
+
     /* I haven''t been able to set the position of
-       the dialog before it is shown, so I do it here */
+       the dialog before it is shown, so I set the
+       position in "realize" and "map" */
     gtk_widget_set_uposition( widget, win->m_x, win->m_y );
     
     /* all this is for Motif Window Manager "hints" and is supposed to be
@@ -245,6 +255,8 @@ bool wxDialog::Create( wxWindow *parent,
 
 wxDialog::~wxDialog()
 {
+    m_isBeingDeleted = TRUE;
+    
     wxTopLevelWindows.DeleteObject( this );
 
     if (wxTheApp->GetTopWindow() == this)
@@ -290,18 +302,14 @@ void wxDialog::OnCancel( wxCommandEvent &WXUNUSED(event) )
 
 void wxDialog::OnOK( wxCommandEvent &WXUNUSED(event) )
 {
-    printf( "OnOK 1.\n" );
     if (Validate() && TransferDataFromWindow())
     {
-        printf( "OnOK 2.\n" );
         if (IsModal())
         {
-            printf( "OnOK: modal.\n" );
             EndModal(wxID_OK);
         }
         else
         {
-            printf( "OnOK: non-modal.\n" );
             SetReturnCode(wxID_OK);
             this->Show(FALSE);
         }
@@ -577,6 +585,8 @@ void wxDialog::SetIcon( const wxIcon &icon )
     m_icon = icon;
     if (!icon.Ok()) return;
 
+    if (!m_widget->window) return;
+
     wxMask *mask = icon.GetMask();
     GdkBitmap *bm = (GdkBitmap *) NULL;
     if (mask) bm = mask->GetBitmap();