[comp.windows.x] Scrollbar widget help needed ...

mershon@heron.cis.ohio-state.edu (Stuart Mershon) (02/18/89)

   I am a novice X11R3 programmer looking for some help in dealing with the
scrollbar widget.  I am trying to use the callback procedure specified by
XtNscrollProc to nudge the thumb a little bit one way or another, depending 
upon which mouse button was pressed.  In order to do this, I have tried to
use XtGetValues, which doesn't want to cooperate.  So, I stepped back to 
the following:

    float top,shown;
 

    top = 0.5;
    shown = -1.0;
    XtScrollBarSetThumb(scrl[call_id],top,shown);

    XtSetArg( arg[0], XtNtop, &top );
    XtGetValues( scrl[call_id], arg, ONE );

   Even though my scrollbar shows the thumb in the proper position, top
always comes back from XtGetValues with a zero value.  Can anyone out there
show me the error of my ways.  Any help is greatly appreciated.

Thanks,
       ... Jeb

mershon@cis.ohio-state.edu

klee@daisy.UUCP (Ken Lee) (02/18/89)

In article <35812@tut.cis.ohio-state.edu> <mershon@cis.ohio-state.edu> writes:
=>    float top,shown;
=>    XtSetArg( arg[0], XtNtop, &top );
=>    XtGetValues( scrl[call_id], arg, ONE );
=>
=>   Even though my scrollbar shows the thumb in the proper position, top
=>always comes back from XtGetValues with a zero value.

Funny, this code works fine for me (X11R3, Sun 386i, SunOS 4.0.1),
assuming scrl[call_id] is a valid widget ID.  Does your machine have a
problem with pointers to floats?

Ken Lee
-- 
klee@daisy.uucp
Daisy Systems Corp., Interactive Graphics Tools Dept.