Page 1 of 1

on CloseStack handler problem

Posted: Tue Dec 25, 2018 2:12 pm
by ameguira@gmail.com
Hi All
I need to init a cd fld and a graph line widget
This is my script:

on closeStack
local tfile, tData, tvalues
// write data to a text file
if fld "results" of cd "results" is not empty then
// pay attention to pathname for mobile
put specialFolderPath("desktop") & "/Margins.txt" into tFile
open file tFile for text write
put fld "results" of cd "results" into tData
write tData to file tFile
close file tFile
//init graph line widget
put "" into fld "results" of cd "results"
put "0,0" & return after tValues
put "No data to display" into fld "Graphlabel" of cd "results"
set the graphData of widget "Line Graph" of cd "results" to tvalues
else
end if
end closeStack


It works fine with a btn (mouseup handler), but with "on CloseStack" handler, impossible to init my 2 objects (fld and widget), but writing the text file works fine !
I have no errors. Strange LC behaviour.
Thanks for help.
Albert MEGUIRA

Re: on CloseStack handler problem

Posted: Tue Dec 25, 2018 2:59 pm
by dunbarx
Change the handler to "closeStackRequest".

This fires before the stack closes. I bet this will fix it.

Craig Newman

Re: on CloseStack handler problem

Posted: Tue Dec 25, 2018 5:41 pm
by ameguira@gmail.com
Thank you Graig
It works
Albert MEGUIRA