Hi,
I have a lot of spinctrls on a page and when the value of one of the
spinctrls changes, the code must do some calculations on a large
datastructure, and present the result on the same page. This works and
all spinctrl changes a bound to a method:
def OnSpinCtrl(self,event):
...do calculation on a lot of data and present the result..
The code works, but the problem is that the calculations take some
time. So when you e.g. change the value of a spinCtrl from 1 to 1000
by pressing the arrow on the spinctrls, 1000 times a recalculation is
done, and this slows the program unnecessary down. When I change 1 to
1000 in a spinCtrl by typing off course everything works fine.
My question: how to smartly decide when to recalculate the result?
I think I need to implement something like a timer, but I don't have a
clue how to do this?
More specific: the result of the intermediate calculations when
changing from 1 to 1000 can go into the trash bin, as long as the
interface feels responsive.
Tia Samuel