5,418
edits
Changes
From Gramps
m
→Advanced Settings
* '''force_update''': set True to have the gramplet update, even when minimized
Calling the update() method of a gramplet causes its main() method to be called repeatedly in the background until it returns False.
Most gramplets will contain a main() method that runs quickly and always returns False.
Gramplets that have more intensive processing will use the main() method as a generator which will be run multiple times in the background. It will return True until it has finished processing then it will return False.
This background task can be controlled with the pause() and resume() methods. Additionally there is an interrupt() method which will cancel execution of the background task, and update_all() which will run the entire task in the foreground immediately.
A background task will continue to run '''even if the gramplet is no longer active'''.
Gramplets that should be updated in response to changes in the database should connect to the appropriate signals.
Gramplets such as a news gramplet could be updated by adding a refresh button or running the update() method at regular intervals.
== Learning More ==