From ea91ff8e339b0bfdff5a81161b5fb2e2b9441801 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Thu, 16 Oct 2008 18:27:16 +0000 Subject: [PATCH] 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 --- samples/dataview/dataview.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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 } -- 2.45.2