comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » WIDGET_SLIDER bug !?!
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
WIDGET_SLIDER bug !?! [message #8126] Fri, 07 February 1997 00:00
Hans-Martin v.Stockha is currently offline  Hans-Martin v.Stockha
Messages: 4
Registered: June 1996
Junior Member
Hi everybody,

i am using IDL 4.01 on an UltraSparc running Solaris 2.5.
Recently i created a WIDGET_SLIDER with a preset MIN of 0
and an undefined MAX (which defaults to 100). As i tried to
change the MAX-value with WIDGET_CONTROL,,/SET_SLIDER_MAX,
values LE 3 caused a segmentation fault.
The same error occurred with completely uninitialized
MIN/MAX values.
Only after i set the initial MAX value to 1, the segmentation
fault disappeared.

b = widget_base()
s = widget_slider(b, min=0, xsize=200, /suppress_value)
widget_control, b, /realize
print,5 & widget_control,s,set_slider_max=5
print,4 & widget_control,s,set_slider_max=4
print,3 & widget_control,s,set_slider_max=3
print,2 & widget_control,s,set_slider_max=2
print,1 & widget_control,s,set_slider_max=1

and the IDL output:

IDL> b = widget_base()
IDL> s = widget_slider(b, min=0, xsize=200, /suppress_value)
IDL> widget_control, b, /realize
IDL> print,5 & widget_control,s,set_slider_max=5
5
IDL> print,4 & widget_control,s,set_slider_max=4
4
IDL> print,3 & widget_control,s,set_slider_max=3
3
% Program caused arithmetic error: Floating illegal operand
% Detected at $MAIN$
Segmentation Fault

If you use the following:

b = widget_base()
s = widget_slider(b, min=0, max=1, xsize=200, /suppress_value)
widget_control, b, /realize
print,5 & widget_control,s,set_slider_max=5
print,4 & widget_control,s,set_slider_max=4
print,3 & widget_control,s,set_slider_max=3
print,2 & widget_control,s,set_slider_max=2
print,1 & widget_control,s,set_slider_max=1

you will get the expected result:

IDL> b = widget_base()
IDL> s = widget_slider(b, min=0, max=1, xsize=200, /suppress_value)
IDL> widget_control, b, /realize
IDL> print,5 & widget_control,s,set_slider_max=5
5
IDL> print,4 & widget_control,s,set_slider_max=4
4
IDL> print,3 & widget_control,s,set_slider_max=3
3
IDL> print,2 & widget_control,s,set_slider_max=2
2
IDL> print,1 & widget_control,s,set_slider_max=1
1
IDL>


Did anybody else came across this error and/or knows a reason
for this behavior?
----
H.-M. v.Stockhausen
[Message index]
 
Read Message
Previous Topic: Re: IDL 5.0 news at RSI website
Next Topic: Re: analysis of spectra

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:25:33 PDT 2025

Total time taken to generate the page: 0.00389 seconds