]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/scrolbar.cpp
Fix memory leak when a spacer is added, and crash when a window is added before wxSiz...
[wxWidgets.git] / src / gtk1 / scrolbar.cpp
index 28cf2350d8576cbefa97f1018a05269f7632c0ee..7c8b236b7f542e55e26276686c575406eeaa0509 100644 (file)
@@ -46,6 +46,7 @@ static const float sensitivity = 0.02;
 
 // FIXME: is GtkScrollType really passed to us as 2nd argument?
 
+extern "C" {
 static void gtk_scrollbar_callback( GtkAdjustment *adjust,
                                     SCROLLBAR_CBACK_ARG
                                     wxScrollBar *win )
@@ -67,10 +68,6 @@ static void gtk_scrollbar_callback( GtkAdjustment *adjust,
 
     int orient = win->HasFlag(wxSB_VERTICAL) ? wxVERTICAL : wxHORIZONTAL;
 
-    wxScrollEvent event( command, win->GetId(), value, orient );
-    event.SetEventObject( win );
-    win->GetEventHandler()->ProcessEvent( event );
-
     // throw a LINEUP / LINEDOWN event if necessary
     if (g_currentUpDownEvent != wxEVT_NULL)
     {
@@ -78,6 +75,11 @@ static void gtk_scrollbar_callback( GtkAdjustment *adjust,
         event.SetEventObject( win );
         win->GetEventHandler()->ProcessEvent( event );
       }
+    
+       // throw other event (wxEVT_SCROLL_THUMBTRACK)
+       wxScrollEvent event( command, win->GetId(), value, orient );
+    event.SetEventObject( win );
+    win->GetEventHandler()->ProcessEvent( event );
 
 /*
     wxCommandEvent cevent( wxEVT_COMMAND_SCROLLBAR_UPDATED, win->GetId() );
@@ -85,10 +87,12 @@ static void gtk_scrollbar_callback( GtkAdjustment *adjust,
     win->ProcessEvent( cevent );
 */
 }
+}
 
 //-----------------------------------------------------------------------------
 // "button_press_event" from slider
 //-----------------------------------------------------------------------------
+extern "C" {
 static gint gtk_scrollbar_button_press_callback( GtkRange *widget,
                                                  GdkEventButton *gdk_event,
                                                  wxScrollBar *win )
@@ -127,11 +131,13 @@ static gint gtk_scrollbar_button_press_callback( GtkRange *widget,
 
     return FALSE;
 }
+}
 
 //-----------------------------------------------------------------------------
 // "button_release_event" from slider
 //-----------------------------------------------------------------------------
 
+extern "C" {
 static gint
 gtk_scrollbar_button_release_callback( GtkRange *WXUNUSED(widget),
                                        GdkEventButton *WXUNUSED(gdk_event),
@@ -158,6 +164,7 @@ gtk_scrollbar_button_release_callback( GtkRange *WXUNUSED(widget),
 
     return FALSE;
 }
+}
 
 //-----------------------------------------------------------------------------
 // wxScrollBar