5
This script is a simple example to show how you can trigger things based on
6
event hooks provided by Scribus. This sample runs the `gotSignal' method
7
when the app has finished setting up and it emits the appStarted() signal.
8
This is useful if, for example, you need access to the main window to
9
do your setup when running as a startup script.
11
This script isn't very interesting unless you run it as a startup script,
12
with Scribus running in an xterm, and watch the output on stdout/stderr.
14
You will need PyQt for this script to work.
20
print "Seems you don't have PyQt. Doing nothing."
23
from qt import SIGNAL, PYSIGNAL, SLOT
25
# Note that to connect to signals etc you MUST inherit from QObject or a subclass
27
class Recipient(qt.QObject):
30
# Connect ourselves to the "appStarted()" signal emitted by Scribus.
31
# Ask PyQt to run the self.gotSignal method when the signal is emitted.
32
self.connect(qt.qApp, SIGNAL("appStarted()"), self.gotSignal)
37
if __name__ == '__main__':