I'm trying to create a simple Python application for Linux and I'm using GTK to generate a UI for it. I've only begun exploring GTK but from what I can tell, the moment you call GTK.main() the program goes into that function wherever and only responds to user interactions with the UI. The thing is, I'm running an SDN controller (POX) alongside, and I want the events associated with instances of POX objects to also be able to run (which currently isn't happening since the program gets stuck in 'GTK.main()' forever).
I've considered creating a new thread and calling GTK.main() from there, but then I'll have to worry about thread safety. Isn't there some way where the events for both the UI as well as the objects instantiated in the rest of the program fire alongside?
I was able to solve the problem by spawning separate threads for both GTK and the POX controller. With this done, everything's working fine simultaneously.
Keep background events active when using GTK