1. onDestroy( ) in win32lib
- Posted by John E. Franklin <johnericfranklin at rock.com> Jan 21, 2006
- 457 views
- Last edited Jan 22, 2006
I don't know if this is working, but nothing is printed as the app closes. I want to close a file if user closes the app with the X button. [code] procedure onDestroy() for iter = 1 to 200 do puts(1,"The end of the program") end for if (FileIsOpen = 'Y') then ------------ close(fileInteger) ---------------------------- FileIsOpen = 'N' ------------------------- end if ---------------- end procedure [/code]
2. Re: onDestroy( ) in win32lib
- Posted by Alex Chamberlain <alex.chamberlain at tiscali.co.uk> Jan 21, 2006
- 470 views
- Last edited Jan 22, 2006
John E. Franklin wrote: > > I don't know if this is working, but > nothing is printed as the app closes. > I want to close a file if user closes the app > with the X button. Have you called setHandler()?
procedure onDestroy() for iter = 1 to 200 do puts(1,"The end of the program") end for if (FileIsOpen = 'Y') then ------------ close(fileInteger) ---------------------------- FileIsOpen = 'N' ------------------------- end if ---------------- end procedure setHandler(mainWindow, w32HClose, routine_id("onDestroy"))
Where mainWindow is your main window - this will work when used with create or createEx - not that stupid createUIForm or whatever its called?! Alex
3. Re: onDestroy( ) in win32lib
- Posted by John E. Franklin <johnericfranklin at rock.com> Jan 21, 2006
- 464 views
- Last edited Jan 22, 2006
Thanks alex, I'll try to figure out how to use setHandler() for the onDestroy(). I just figured it was automatic. Thanks a lot!