- int direction = (style & wxHORIZONTAL) ? XmHORIZONTAL: XmVERTICAL;
-
- Widget scrollBarWidget = XtVaCreateManagedWidget("scrollBarWidget",
- xmScrollBarWidgetClass, parentWidget,
- XmNorientation, direction,
- NULL);
-
- m_mainWidget = (Widget) scrollBarWidget;
-
- // This will duplicate other events
- // 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);
- XtAddCallback(scrollBarWidget, XmNpageDecrementCallback, (XtCallbackProc)wxScrollBarCallback, (XtPointer)this);
- XtAddCallback(scrollBarWidget, XmNpageIncrementCallback, (XtCallbackProc)wxScrollBarCallback, (XtPointer)this);
- 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();
-
- return TRUE;
+
+ m_mainWidget =
+ DoCreateScrollBar( (WXWidget)parentWidget,
+ (wxOrientation)(style & (wxHORIZONTAL|wxVERTICAL)),
+ (void (*)())wxScrollBarCallback );
+
+ PostCreation();
+ AttachWidget (parent, m_mainWidget, (WXWidget) NULL,
+ pos.x, pos.y, newSize.x, newSize.y);
+
+ return true;