Strange behavior of XawScrollbarSetThumb

Strange behavior of XawScrollbarSetThumb

Post by Thomas Rin » Tue, 21 Apr 1998 04:00:00



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
 
 
 

Strange behavior of XawScrollbarSetThumb

Post by Edward A. Fa » Fri, 24 Apr 1998 04:00:00




Quote:>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. ...

I can't swear that this is the same problem you're having, but I've
observed that the XawScrollbarSetThumb() function is sensitive
to float vs. double declarations, at least on the x86 cpus.  In
particular, a program compiled with the defaults will produce the
wrong results.

Programs which link to the athena widgets and which #include
<X11/Xaw/Scrollbar.h> need to have NeedWidePrototypes declared
properly for their system.

If you use Imakefiles, you should have no problem.  In fact, it was
this issue that prompted me to learn how to use imake.

--

Visit http://www.rahul.net/falk/whatToDo.html       ****#*#**************F******!*
and read 12 Simple Things You Can Do            *****!*!!**********!**********
to Save the Internet                            *****************#

 
 
 

1. Problem with XawScrollbarSetThumb()

I am running the 1.2.13 kernel and using gcc 2.6.3, with libXaw.so.6.0 and libXaw.a

I have several programs that use XawScrollbarSetThumb.  These work fine on many
other platforms, but they fail on LINUX.  Debugging, while looking at the args
for the the thumb position and length show that XawScrollbarSetThumb is not
setting these values and the way the thumb behaves reflects that.  If I grab
the code for XawScrollbarSetThumb from the source to libXaw and include that
directly, things work fine.

Has any one seen difficulties like this???? If so, do you have any suggestions.

With the same effect on several codes, one tends to dismiss a problem in the codes
and blame it on libXaw, but I also would find it surprising that libXaw would
have such a fundamental problem.


Thanks for any help!!!!!

--

Harry

2. libX11.so.6 exec error, please help.

3. OGI Speech Tools, SIGFPE in XawScrollbarSetThumb

4. SNI-19:BSD lpd vulnerabilities

5. XawScrollbarSetThumb broken??

6. Ver 3.2.5 mksysb tape problem

7. XawScrollBarSetThumb(): argh ?

8. iconify a program

9. Strange NFS behaviour

10. Strange Netscape Behavior with RH 6.2

11. Strange behavior of socket communication

12. Strange behaviour of "setbuf" on HP

13. Strange Behaviour of sar and cpuhog