]> git.saurik.com Git - wxWidgets.git/commitdiff
Catching dclick event from a spinbutton or spin control
authorRobert Roebling <robert@roebling.de>
Sun, 8 Dec 2002 18:02:30 +0000 (18:02 +0000)
committerRobert Roebling <robert@roebling.de>
Sun, 8 Dec 2002 18:02:30 +0000 (18:02 +0000)
    crashes GTK 1.2 sooner or later. Just disable this
    event for now. Should also be in 2.4, actually.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18112 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

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

index bf5f12cdb88a18350f522f7171da8c8bf5fb92d3..2cee058d32e6b6826198459a16a474d0cfd4755f 100644 (file)
@@ -1695,6 +1695,20 @@ static gint gtk_window_button_press_callback( GtkWidget *widget,
     wxPrintf( wxT(".\n") );
 */
 
+#ifndef __WXGTK20__
+    if (event_type == wxEVT_LEFT_DCLICK)
+    {
+        // GTK 1.2 crashes when intercepting double
+        // click events from both wxSpinButton and
+        // wxSpinCtrl
+        if (GTK_IS_SPIN_BUTTON(win->m_widget))
+        {
+            // Just disable this event for now.
+            return FALSE;
+        }
+    }
+#endif
+
     if (win->GetEventHandler()->ProcessEvent( event ))
     {
         gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "button_press_event" );
@@ -1898,7 +1912,7 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget,
 
     wxLogTrace(TRACE_FOCUS,
                _T("%s: focus in"), win->GetName().c_str());
-
+    
 #ifdef HAVE_XIM
     if (win->m_ic)
         gdk_im_begin(win->m_ic, win->m_wxwindow->window);
index bf5f12cdb88a18350f522f7171da8c8bf5fb92d3..2cee058d32e6b6826198459a16a474d0cfd4755f 100644 (file)
@@ -1695,6 +1695,20 @@ static gint gtk_window_button_press_callback( GtkWidget *widget,
     wxPrintf( wxT(".\n") );
 */
 
+#ifndef __WXGTK20__
+    if (event_type == wxEVT_LEFT_DCLICK)
+    {
+        // GTK 1.2 crashes when intercepting double
+        // click events from both wxSpinButton and
+        // wxSpinCtrl
+        if (GTK_IS_SPIN_BUTTON(win->m_widget))
+        {
+            // Just disable this event for now.
+            return FALSE;
+        }
+    }
+#endif
+
     if (win->GetEventHandler()->ProcessEvent( event ))
     {
         gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "button_press_event" );
@@ -1898,7 +1912,7 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget,
 
     wxLogTrace(TRACE_FOCUS,
                _T("%s: focus in"), win->GetName().c_str());
-
+    
 #ifdef HAVE_XIM
     if (win->m_ic)
         gdk_im_begin(win->m_ic, win->m_wxwindow->window);