UPDATE: I changed how my program works, its now threaded. Heres the threading code:
Code:
class trayThread ( threading.Thread ):
def run ( self ):
tmp = trayTest.trayIcon()
gtk.main()
class readerThread ( threading.Thread ):
def run ( self ):
while(1>0):
print strftime("%H:%M:%S", localtime()) + " Checking..."
checkMail()
print strftime("%H:%M:%S", localtime()) + " Done!"
time.sleep(120)
if __name__=="__main__":
readerThread().start()
trayThread().start()
trayTest.trayIcon() is the tray icon, and the window is opened using self.icon.connect("activate", self.openWindow)
Now when I close the window, the tray icon stops responding and will not go away. Heres the code for the window to close:
Code:
def delete_event(self, widget, event, data=None):
gtk.main_quit()
return False
def destroy(self, widget, data=None):
print "Destroy signal occurred, exiting..."
self.delete_event(self,self.window,None)
Ideas?
(If you want to see more of the code, ask)
Bookmarks