Hi,
I have a problem with XawScrollbarSetThumb(). Called from the code
shown below, this function apparently fails to set position and size
of the scrollbar's thumb. Setting the same parameters with
XtVaSetValues(), however, works fine. I guess that the problem is
hidden somewhere in the code below, as other Xaw widgets like
Text or Viewport use calls to XawScrollbarSetThumb() successfully.
I am using Xaw3d 1.3. Can somebody point me to the right direction,
as I have no idea what's wrong with this code.
- Thomas
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Xaw3d/Scrollbar.h>
int main(int nArgs, char** args) {
XtAppContext context;
Widget top, scroll;
float topOfThumb, shown;
top = XtVaAppInitialize(&context,
"Scroll",
NULL, 0,
&nArgs, args,
NULL,
NULL);
scroll = XtVaCreateManagedWidget("scroll",
scrollbarWidgetClass,
top,
XtNlength, 200,
NULL);
topOfThumb = 0.0;
shown = 1.0;
XawScrollbarSetThumb(scroll,(double)topOfThumb,(double)shown);
/*
* Uncomment this to see what the thmb should look like
XtVaSetValues(scroll,
XtNtopOfThumb, *(XtArgVal*)&topOfThumb,
XtNshown, *(XtArgVal*)&shown,
NULL);
*/
XtRealizeWidget(top);
XtAppMainLoop(context);
return 0;
-Quote:}
Thomas Rink
Lehrstuhl f. Biophysik
Ruhr-Universitaet Bochum
D-44780 Bochum, Germany