diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index 20c77eec98..8e5a52297f 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -667,6 +667,12 @@ void wxListBox::Clear() wxCHECK_RET( m_list != NULL, wxT("invalid listbox") ); gtk_list_clear_items( m_list, 0, GetCount() ); + + if ( GTK_LIST(m_list)->last_focus_child != NULL ) + { + // This should be NULL, I think. + GTK_LIST(m_list)->last_focus_child = NULL; + } if ( HasClientObjectData() ) { diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 830bfd343c..01d6e259a2 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -3237,6 +3237,13 @@ void wxWindowGTK::SetFocus() { wxCHECK_RET( (m_widget != NULL), wxT("invalid window") ); +#if 0 + wxPrintf( "SetFocus from " ); + if (GetClassInfo() && GetClassInfo()->GetClassName()) + wxPrintf( GetClassInfo()->GetClassName() ); + wxPrintf( ".\n" ); +#endif + if (m_wxwindow) { if (!GTK_WIDGET_HAS_FOCUS (m_wxwindow)) @@ -3261,6 +3268,14 @@ void wxWindowGTK::SetFocus() // ? } } + +#if 0 + wxPrintf( "SetFocus finished in " ); + if (GetClassInfo() && GetClassInfo()->GetClassName()) + wxPrintf( GetClassInfo()->GetClassName() ); + wxPrintf( ".\n" ); +#endif + } bool wxWindowGTK::AcceptsFocus() const diff --git a/src/gtk1/listbox.cpp b/src/gtk1/listbox.cpp index 20c77eec98..8e5a52297f 100644 --- a/src/gtk1/listbox.cpp +++ b/src/gtk1/listbox.cpp @@ -667,6 +667,12 @@ void wxListBox::Clear() wxCHECK_RET( m_list != NULL, wxT("invalid listbox") ); gtk_list_clear_items( m_list, 0, GetCount() ); + + if ( GTK_LIST(m_list)->last_focus_child != NULL ) + { + // This should be NULL, I think. + GTK_LIST(m_list)->last_focus_child = NULL; + } if ( HasClientObjectData() ) { diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 830bfd343c..01d6e259a2 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -3237,6 +3237,13 @@ void wxWindowGTK::SetFocus() { wxCHECK_RET( (m_widget != NULL), wxT("invalid window") ); +#if 0 + wxPrintf( "SetFocus from " ); + if (GetClassInfo() && GetClassInfo()->GetClassName()) + wxPrintf( GetClassInfo()->GetClassName() ); + wxPrintf( ".\n" ); +#endif + if (m_wxwindow) { if (!GTK_WIDGET_HAS_FOCUS (m_wxwindow)) @@ -3261,6 +3268,14 @@ void wxWindowGTK::SetFocus() // ? } } + +#if 0 + wxPrintf( "SetFocus finished in " ); + if (GetClassInfo() && GetClassInfo()->GetClassName()) + wxPrintf( GetClassInfo()->GetClassName() ); + wxPrintf( ".\n" ); +#endif + } bool wxWindowGTK::AcceptsFocus() const