When you connect a handler (like onSelectionChanged
) to a signal (like "changed"
), the handler is added to the end of the list of signal handlers of that object.
When the object then emits the signal, it will call handlers (or "callbacks") in this list, pasing itself as the first argument.
This is true for all signals: the first argument is allways the object emitting the signal.
This way, you can e.g. call the get_selected()
method of the TreeSelection
object that called your onSelectionChanged
method: you access it through the tree_selection
parameter.