Changes

Jump to: navigation, search

Signals and Callbacks

133 bytes added, 12 June
no edit summary
{{man tip|Information on developing for Gramps}}
The Gramps signaling system is used to pass changes in the db, GUI, or other sources to various elements (usually the GUI) that need to be updated when changes occur.
== Callback ==
For the db and most of the GUI, the [https://github.com/gramps-project/gramps/blob/master/gramps/gen/utils/callback.py callback.py ] module with its Callback class provides much of the functionality. The Callback class is usually a base class for modules that emit and allow connection to callbacks, so its methods become part of the main class. An example is the class DbBsddbRead, or the displaystate.py History class. When emitting or connecting to a callback it is important to use the correct object in calling the method. If your code needs to see a 'databased-changed' and 'person-update' signals, for instance, you might use:
self.dbstate.connect('database-changed', self.db_changed)
self.db.connect('person-update', self.update)
2,073
edits

Navigation menu