From: Robert Roebling Date: Thu, 16 Oct 2008 18:27:16 +0000 (+0000) Subject: Write directly to log target wxTextCtrl to avoid crash X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/ea91ff8e339b0bfdff5a81161b5fb2e2b9441801?ds=sidebyside Write directly to log target wxTextCtrl to avoid crash git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56370 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/dataview/dataview.cpp b/samples/dataview/dataview.cpp index 4ff3a96798..4d24a1ea48 100644 --- a/samples/dataview/dataview.cpp +++ b/samples/dataview/dataview.cpp @@ -1032,6 +1032,10 @@ void MyFrame::OnSelectionChanged( wxDataViewEvent &event ) #ifdef ENABLE_LOGGING wxLogMessage(wxT("wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, First selected Item: %s"), title ); +#else + wxString text; + text.Printf( wxT("wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, Item: %s\n"), title ); + m_log->WriteText( text ); #endif } @@ -1043,6 +1047,10 @@ void MyFrame::OnExpanding( wxDataViewEvent &event ) wxString title = m_music_model->GetTitle( event.GetItem() ); #ifdef ENABLE_LOGGING wxLogMessage(wxT("wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING, Item: %s"), title ); +#else + wxString text; + text.Printf( wxT("wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING, Item: %s\n"), title ); + m_log->WriteText( text ); #endif } @@ -1077,6 +1085,10 @@ void MyFrame::OnExpanded( wxDataViewEvent &event ) wxString title = m_music_model->GetTitle( event.GetItem() ); #ifdef ENABLE_LOGGING wxLogMessage(wxT("wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED, Item: %s"), title ); +#else + wxString text; + text.Printf( wxT("wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED, Item: %s\n"), title ); + m_log->WriteText( text ); #endif } @@ -1088,6 +1100,10 @@ void MyFrame::OnCollapsing( wxDataViewEvent &event ) wxString title = m_music_model->GetTitle( event.GetItem() ); #ifdef ENABLE_LOGGING wxLogMessage(wxT("wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING, Item: %s"), title ); +#else + wxString text; + text.Printf( wxT("wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING, Item: %s\n"), title ); + m_log->WriteText( text ); #endif } @@ -1099,6 +1115,10 @@ void MyFrame::OnCollapsed( wxDataViewEvent &event ) wxString title = m_music_model->GetTitle( event.GetItem() ); #ifdef ENABLE_LOGGING wxLogMessage(wxT("wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED, Item: %s"),title); +#else + wxString text; + text.Printf( wxT("wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED, Item: %s\n"), title ); + m_log->WriteText( text ); #endif }