Andrew is suggesting you insert a small delay in
between getting the signal the 'selection_changed' signal and actually
doing something about it. By adding the delay you allow time for then next signal to come along + if you get a second signal you should reset the timer to zero, to allow for yet another user event. By tuning the size of the delay you'll cut down the number of signals for which you actually do something and performance should be good. You need to check-out gobject.timeout_add() and gobject.source_remove(), which will allow you to set your processing to be triggered after the delay. source_remove is needed so that you can cancel an earlier timeout_add when you get a second 'selection_changed' event. Hope that helps. John Matthias Kaeppler wrote:
|