On 19 jun, 11:55, Paul van Delst <Paul.vanDe...@noaa.gov> wrote:
> aleks.fra...@gmail.com wrote:
>> Hello!
>> Maybe it's a likely simple question, but I can't figure it out. I have
>> 2 buttons and I want them to communicate. My widget has 2 buttons and
>> each button is a separate event. Button A chooses an image A to open.
>> Button B chooses an image B to open. I need to keep the information
>> from image A in order to compare with image B. Because they are 2
>> separate events, when the first events ends ( opens image A ) all the
>> information about image A is lost. What do I need to do to keep the
>> information from an event and use it in another event?
>
> What do you mean be "information from image A" ? The image itself (for comparison with
> image B) or information about image A (e.g. size, min/max vals etc) ?
>
> Asking the same question a bit more broadly: What, exactly, do you want your widget to do?
>
> cheers,
>
> paulv
>
> --
> Paul van Delst Ride lots.
> CIMSS @ NOAA/NCEP/EMC Eddy Merckx
Ok, I'll try it in another way.
I have I have 2 buttons: Open1 and Open2
;Starts here
CASE eventval OF
'Open1' :BEGIN
cd,'c:\rsi\idl63\examples\data'
envi_select, title="WAVECHANGE: Select 'Initial State' Image",$
fid=fid1, dims=dims1, pos=pos1
if (fid1 eq -1) then return
envi_file_query, fid1, fname=fname1, bname=bname1,$
data_type=data_type1,$
ns=ns1, nl=nl1, nb=nb1,$
sname=sname1, xstart=xstart1, ystart=ystart1
WIDGET_CONTROL,(*pinfo).wOpen1,SENSITIVE=0
WIDGET_CONTROL,(*pinfo).wOpen2,SENSITIVE=1
END
'Open2' :BEGIN
envi_select, title="WAVECHANGE: Select 'Final State' Image",$
fid=fid2, dims=dims2, pos=pos2
if (fid2 eq -1) then return
envi_file_query, fid2, fname=fname2, bname=bname2,$
data_type=data_type2,$
ns=ns2, nl=nl2, nb=nb2,$
sname=sname2, xstart=xstart2, ystart=ystart2
name_pos = STRPOS(fname1, '\', /REVERSE_SEARCH)
path=STRMID(fname1, 0,name_pos+1)
;;
;;_____HERE IS THE PROBLEM..
;;_____I need to compare fid1 with fid2, but the program kills all
information from 'Open1' event
;;
if (fid1 eq fid2) then begin
message=[["You have selected the same image twice!"],[""],
["Please, select both images again"]]
result=dialog_message (message,title="Error!", /error)
return
endif
if (nb1 ne nb2) then begin
message=[["The selected images must have the same number of
bands!"],[""],["Please, select both images again"]]
result=dialog_message (mensagem,title="Error!", /error)
return
endif
END
When I finish the first case, it seems that all the information about
'Open1' is killed. I need the variables from Open1 to use them im my
'Open2'. In other words, I need to retreave the variables: fid1, dim1,
pos1, data_type1, ns1, nl1, nb1, sname1, xstart1, ystart1.
I hope I was clear this time.
Thank you.
|