99 | | ===== Adding a timer ==== |
| 99 | ===== Adding a timer ===== |
| 100 | addTimeout(self, callback, timeout, caller, description, args=[]) |
| 101 | ''callback'' - method that will be called by the timer[[br]] |
| 102 | ''timeout'' - timeout in milliseconds[[br]] |
| 103 | ''caller'' - instance of the calling module[[br]] |
| 104 | ''description'' - a short string describing what the timer does[[br]] |
| 105 | ''args'' - an optional list of arguments for the callback function[[br]] |
| 106 | |
| 107 | The addTimeout method returns an id, that can be used to manipulate the the timer during its lifetime. If the callback method returns == False (must be False, not "", 0, [] or similar), the timer is automatically canceled. |