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

Home » Public Forums » archive » Re: re-create a widget
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: re-create a widget [message #70112 is a reply to message #70097] Wed, 10 March 2010 19:55 Go to previous message
jeffnettles4870 is currently offline  jeffnettles4870
Messages: 111
Registered: October 2006
Senior Member
On Mar 10, 12:30 pm, titan <thunder...@inwind.it> wrote:
> Hi all,
> I'm trying to write a simple widget which permits to insert 2 values
> and check if the min value is less than the max value. If not a
> message error appears. My problem is that once the "quit" button of
> this error message is pressed I'm not able to re-open the first widget
> in order to correct the values inserted.
> How can I handle this aspect?
>
> thanks
>
> here you can find the code:
>
> PRO quit_button_event, event
> WIDGET_CONTROL,event.top,/DESTROY ;
> END
>
>  input_param = WIDGET_AUTO_BASE(title='Input data range')
>
>  p1 = WIDGET_PARAM(input_param, /auto_manage, dt=4, field=3,
> DEFAULT='7.5',$
>                    prompt='minimum std dev of heights value',
> uvalue='p1')
>
>  p2 = WIDGET_PARAM(input_param, /auto_manage, dt=4, field=3,
> DEFAULT='4.5',$
>                    prompt='maximum std dev of heights value',
> uvalue='p2')
>  result=AUTO_WID_MNG(input_param)
>  IF (result.accept eq 0) THEN return
>
> min_val = result.p1
> max_val = result.p2
>
> IF (min_val GT max_val)  THEN BEGIN
> base_err = WIDGET_BASE(TITLE = 'INPUT ERROR info', XSIZE = 500, /
> COLUMN, XOFFSET=500, YOFFSET=300)
>         row_err = WIDGET_BASE(base_err, /ROW,/FRAME)
>         err_label = WIDGET_LABEL(row_err,VALUE='ERROR MESSAGE ',/
> DYNAMIC_RESIZE)
>         err_msg = widget_TEXT(row_err,VALUE='Please check if the
> maximum/minimum order inserted is correct',XSIZE=60)
>         row_quit_button = WIDGET_BASE(base_err, /ROW,/FRAME, /
> ALIGN_CENTER)
>         quit_button= WIDGET_BUTTON(row_quit_button, VALUE='QUIT',
> UVALUE='Quit', XSIZE = 100,/ALIGN_CENTER)
>         WIDGET_CONTROL, base_err, /REALIZE
>         XMANAGER, 'wid_err',
> base_err,event_handler='quit_button_event'
>      ENDIF
> end

If nothing else you can always have your error message say "You need
to fix your values" or something to that effect, then just redisplay
the original widget, check it again, and repeat as necessary...
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: rejecting a few pixel values from an array of pixel values
Next Topic: Re: rejecting a few pixel values from an array of pixel values

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

Current Time: Wed Oct 08 18:07:18 PDT 2025

Total time taken to generate the page: 0.00434 seconds