I am creating a Quickly application that makes use of Python Twisted. When the user launches a window, I want to start the Twisted server I wrote. However, when I do this, it freezes the GUI, because the reactor.run method is constantly running after it is started. I need a way to start the Twisted reactor in its own thread, so that the GUI will continue to operate while the reactor is running. I have read about using Twisted with pyGTK in the Twisted documentation, but I am not sure how I would accomplish this with a Quickly application. What is the best way to start my Twisted server when a window opens without freezing the GUI?
if __name__ == '__main__' statement at the end of my dialog file is:
print 'Preparing GLib' GLib.idle_add(before_running) print 'Staring Reactor' from twisted.internet import reactor reactor.run()`
I have imported and installed twisted.gtk3reactor earlier on in the file. The before_running method contains
dialog = ClientDialog() and
dialog.show, as well as the rest of the code I want to run when the dialog opens.