This can be implemented after libscratchcpp starts using signals and slots (https://github.com/scratchcpp/libscratchcpp/issues/475).