From bbbb13f52a0b2c60cbd65547f9eb439c8ec4b7d9 Mon Sep 17 00:00:00 2001 From: jgoerzen Date: Fri, 3 Jan 2003 03:00:23 +0100 Subject: [PATCH] /offlineimap/head: changeset 292 Beginning of work to make it work with a threaded Tcl/Tk Tkinter. --- offlineimap/head/debian/changelog | 6 ++++++ offlineimap/head/offlineimap/ui/Tk.py | 12 +++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/offlineimap/head/debian/changelog b/offlineimap/head/debian/changelog index bbfa229..2cd1a7e 100644 --- a/offlineimap/head/debian/changelog +++ b/offlineimap/head/debian/changelog @@ -1,3 +1,9 @@ +offlineimap (3.99.6) unstable; urgency=low + + * Beginnings of work to make it work with a threaded Tcl/Tk Tkinter. + + -- John Goerzen Thu, 2 Jan 2003 13:59:44 -0600 + offlineimap (3.99.5) unstable; urgency=low * Added ability to disable expunging on the server. diff --git a/offlineimap/head/offlineimap/ui/Tk.py b/offlineimap/head/offlineimap/ui/Tk.py index 9e8a345..e798f17 100644 --- a/offlineimap/head/offlineimap/ui/Tk.py +++ b/offlineimap/head/offlineimap/ui/Tk.py @@ -19,7 +19,7 @@ from Tkinter import * import tkFont from threading import * -import thread, traceback, time +import thread, traceback, time, threading from StringIO import StringIO from ScrolledText import ScrolledText from offlineimap import threadutil, version @@ -152,18 +152,20 @@ class VerboseUI(UIBase): return 0 def _createTopWindow(self, doidlevac = 1): - self.top = Tk() - self.top.title(version.productname + " " + version.versionstr) self.threadframes = {} self.availablethreadframes = [] self.tflock = Lock() self.notdeleted = 1 + self.created = threading.Event() t = threadutil.ExitNotifyThread(target = self._runmainloop, name = "Tk Mainloop") t.setDaemon(1) t.start() + self.created.wait() + del self.created + if doidlevac: t = threadutil.ExitNotifyThread(target = self.idlevacuum, name = "Tk idle vacuum") @@ -171,6 +173,9 @@ class VerboseUI(UIBase): t.start() def _runmainloop(s): + s.top = Tk() + s.top.title(version.productname + " " + version.versionstr) + s.created.set() s.top.mainloop() s.notdeleted = 0 @@ -364,6 +369,7 @@ class Blinkenlights(VerboseUI): s.fontfamily = config.get('ui.Tk.Blinkenlights', 'fontfamily') if config.has_option('ui.Tk.Blinkenlights', 'fontsize'): s.fontsize = config.getint('ui.Tk.Blinkenlights', 'fontsize') + def _createTopWindow(self): VerboseUI._createTopWindow(self, 0) #self.top.resizable(width = 0, height = 0)