]> git.saurik.com Git - wxWidgets.git/commitdiff
Tries to fix wxListBox focus problems.
authorRobert Roebling <robert@roebling.de>
Thu, 22 Nov 2001 11:38:56 +0000 (11:38 +0000)
committerRobert Roebling <robert@roebling.de>
Thu, 22 Nov 2001 11:38:56 +0000 (11:38 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12588 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/listbox.cpp
src/gtk/window.cpp
src/gtk1/listbox.cpp
src/gtk1/window.cpp

index 20c77eec98523983fb94b8b59dd7b27b30dddefc..8e5a52297f84c90154e08d4af36fda72ffc469bb 100644 (file)
@@ -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() )
     {
index 830bfd343c211bb067ffc5fb3cc81d8351381c34..01d6e259a24214450e94f9b8a74bc39f17d19659 100644 (file)
@@ -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
index 20c77eec98523983fb94b8b59dd7b27b30dddefc..8e5a52297f84c90154e08d4af36fda72ffc469bb 100644 (file)
@@ -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() )
     {
index 830bfd343c211bb067ffc5fb3cc81d8351381c34..01d6e259a24214450e94f9b8a74bc39f17d19659 100644 (file)
@@ -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