So, essentially, I want something that can do this:
def onKeyPress(widget, event):
if event.state & gtk.gdk.CONTROL_MASK and keyname == "a":
Stop the loop somehow.
def doLoop(widget):
while True:
print "You're in"
print "a loop"
mywindow = gtk.Window()
mywindow.connect("key_press_event", onKeyPress)
foo = gtk.Foo()
foo.connect("bar", doLoop)
mywindow.add(foo)
I don't know how to accomplish this, but I have tried using threading or different .py files, but I am kind of a beginner, so I want to know if there's an easier way.