Setting Value of PtNumericFloat widget causes core dump

Dear All,

Trying to set the value of a PtNumericFloat widget with the following
call results in a crash:

double number = 5.55;
PtSetResource(ABW_number, Pt_ARG_NUMERIC_VALUE, number, 0);

Also, setting resources such as the increment delta and maximum value do not have any effect. Has anyone had a similar problem?

I’m using PhAB 2.01 and
QNXRTP QNX a2c-kpl 6.00 2000/10/17-14:59:25edt x86pc x86

Here is the output of make for an interface containing only a PtNumericFloat widget:

or i in gcc_ntox86 ; do (cd $i; make shr) ; done
make[1]: Entering directory /home/kpl/float_test/src/gcc_ntox86' qcc abmain.o number_change.o -Vgcc_ntox86 -Wc,-O3 -fomit-frame-pointer -Wl,-O3 -fomit-frame-pointer -l phexlib -l Ap -l ph -Bstatic -l ph -M -o float_test /usr/bin/ld: warning: libc.so.1, needed by /x86/usr/lib/libAp.so, not found (try using --rpath) usemsg float_test ../Usemsg phabbind float_test base.wgtw make[1]: Leaving directory /home/kpl/float_test/src/gcc_ntox86’

Thanks.

Kevin P. Ladenheim <Kevin.Ladenheim@jhuapl.edu> wrote:
: Dear All,

: Trying to set the value of a PtNumericFloat widget with the following
: call results in a crash:

: double number = 5.55;
: PtSetResource(ABW_number, Pt_ARG_NUMERIC_VALUE, number, 0);

: Also, setting resources such as the increment delta and maximum value do not have any effect. Has anyone had a similar problem?

You’re treating these resources as scalar, but they’re not; they’re Structs.
Try this to set them:

double number = 5.55;
PtSetResource(ABW_number, Pt_ARG_NUMERIC_VALUE, &number, 0);

(i.e. you need an ampersand in front of “number”).

To get them, try this:

double *number;

PtGetResource(ABW_number, Pt_ARG_NUMERIC_VALUE, &number, 0);
printf (“The value is %f\n”, *number);


Steve Reid stever@qnx.com
TechPubs (Technical Publications)
QNX Software Systems