X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/32ac755d4a48496ecea17a50c216d44078f8dc8b..0c0890656219df340e90c8f3ba230c50490096aa:/src/gtk/dialog.cpp diff --git a/src/gtk/dialog.cpp b/src/gtk/dialog.cpp index 43e102b9aa..987c3b9c34 100644 --- a/src/gtk/dialog.cpp +++ b/src/gtk/dialog.cpp @@ -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) @@ -284,24 +296,20 @@ void wxDialog::OnCancel( wxCommandEvent &WXUNUSED(event) ) else { SetReturnCode(wxID_CANCEL); - this->Show(FALSE); + Show(FALSE); } } 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); } @@ -508,21 +516,11 @@ bool wxDialog::Show( bool show ) GtkOnSize( m_x, m_y, m_width, m_height ); } - if (show != m_isShown) - { - if (show) - { - gtk_widget_show( m_widget ); - } - else - gtk_widget_hide( m_widget ); - - m_isShown = show; - } + bool ret = wxWindow::Show( show ); if (show) InitDialog(); - return TRUE; + return ret; } bool wxDialog::IsModal() const @@ -587,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();