]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/scrolbar.cpp
assert is raised when using the thread sample (which works) so the test is
[wxWidgets.git] / src / motif / scrolbar.cpp
index a6d1870345fd7916b4f0bd198779a5de5f805478..c882178a53bcc3601b95aef939812bfb249ca60b 100644 (file)
@@ -13,6 +13,8 @@
 #pragma implementation "scrolbar.h"
 #endif
 
+#include "wx/defs.h"
+
 #include "wx/scrolbar.h"
 
 #ifdef __VMS__
@@ -85,8 +87,7 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
 
     m_mainWidget = (Widget) scrollBarWidget;
 
-    // This will duplicate other events
-    //    XtAddCallback(scrollBarWidget, XmNvalueChangedCallback, (XtCallbackProc)wxScrollBarCallback, (XtPointer)this);
+    XtAddCallback(scrollBarWidget, XmNvalueChangedCallback, (XtCallbackProc)wxScrollBarCallback, (XtPointer)this);
     XtAddCallback(scrollBarWidget, XmNdragCallback, (XtCallbackProc)wxScrollBarCallback, (XtPointer)this);
     XtAddCallback(scrollBarWidget, XmNdecrementCallback, (XtCallbackProc)wxScrollBarCallback, (XtPointer)this);
     XtAddCallback(scrollBarWidget, XmNincrementCallback, (XtCallbackProc)wxScrollBarCallback, (XtPointer)this);
@@ -95,7 +96,6 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
     XtAddCallback(scrollBarWidget, XmNtoTopCallback, (XtCallbackProc)wxScrollBarCallback, (XtPointer)this);
     XtAddCallback(scrollBarWidget, XmNtoBottomCallback, (XtCallbackProc)wxScrollBarCallback, (XtPointer)this);
 
-    SetCanAddEventHandler(TRUE);
     AttachWidget (parent, m_mainWidget, (WXWidget) NULL, x, y, width, height);
     ChangeBackgroundColour();
 
@@ -180,8 +180,8 @@ static void wxScrollBarCallback(Widget WXUNUSED(widget), XtPointer clientData,
                         XmScaleCallbackStruct *cbs)
 {
     wxScrollBar *scrollBar = (wxScrollBar *)clientData;
-
     wxEventType eventType = wxEVT_NULL;
+
     switch (cbs->reason)
     {
         case XmCR_INCREMENT:
@@ -201,9 +201,7 @@ static void wxScrollBarCallback(Widget WXUNUSED(widget), XtPointer clientData,
         }
         case XmCR_VALUE_CHANGED:
         {
-            // TODO: Should this be intercepted too, or will it cause
-            // duplicate events?
-            eventType = wxEVT_SCROLL_THUMBTRACK;
+            eventType = wxEVT_SCROLL_THUMBRELEASE;
             break;
         }
         case XmCR_PAGE_INCREMENT: