Disabling a button during the computation??
- To: mathgroup at smc.vnet.net
- Subject: [mg15037] Disabling a button during the computation??
- From: Ville T Oikarinen <oikarine at cc.helsinki.fi>
- Date: Wed, 9 Dec 1998 04:12:22 -0500
- Organization: University of Helsinki
- Sender: owner-wri-mathgroup at wolfram.com
Hello, fellow-Mathematicans! I have programmed a user interface with Mathematica. My problem is that if the user clicks the button repeatedly, the kernel is called many times for evaluation. The button function makes some changes in global data so data integrity problems arise. In fact, either the program or the whole Mathematica crashes. I don't think disabling the button in the beginning of the button function will be sufficient, because the user may click the button even faster than Mathematica evaluates the beginning of the function. So is it possible either to disable multiple kernel calls, i.e. synchronize the front end and the kernel, or synchronize the button function with itself so that the later calls of the button function know that they are "too late?" Please, anyone know? Ville Oikarinen P.S. The program is a learning program for students so I can't expect the users to be patient and only click once:-)