Tkinter in thread hangs on windows but not on Linux

P

Philippe C. Martin

Hi,

I need to pop-up in a "modless" manner some windows from an existing
Tkinter loop. The following code works OK under Linux: the second window
opens, shows the information, and quits cleanly when destroyed. However,
under windows, I get the second window without the content (so I hang in
run I guess), and both the thread and the calling process hang.

Any clue ?

Thanks
Philippe





#*******************************************************************************
class SC_DOCS(threading.Thread):
__m_smg = None
__m_title = None
def __init__(self,p_msg,p_title):
threading.Thread.__init__(self)
self.__m_msg = p_msg
self.__m_title = p_title

#*******************************************************************************
def run (self):
l_r = Tk()
l_r.title(self.__m_title)
l_f = Frame(l_r)
l_f.pack(side=TOP, expand=YES, fill=BOTH)
l_st = ScrolledText(l_f)
l_st.pack(side=TOP, expand=YES, fill=BOTH)
l_st.insert(END,self.__m_msg)

l_r.mainloop()


..
..
..

l_d = SC_DOCS('A MESSAGE', 'A TITLE')
l_d.start()


..
..
..
--
***************************
Philippe C. Martin
SnakeCard LLC
www.snakecard.com
***************************
 
K

Kamilche

This example worked for me on Windows 2000, after inserting

import threading
from Tkinter import *
import ScrolledText


at the top.
 
P

Philippe C. Martin

Well this is what is on the top of my script:
from Tkinter import *
import threading
from ScrolledText import *

I still hang under XP .... wish I had 2K to test.

I almost sounds like tkinter does not get refresh events anymore.

I'll keep at it
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,744
Latest member
CortneyMcK

Latest Threads

Top