[Anygui-users] window creation doesn't work after some socket calls in msw
Brought to you by:
mlh
|
From: sum t. <sum...@ho...> - 2003-05-09 01:38:39
|
The window created after accept() appears and dissappears instantly in msw
on Windows. Sometimes the window appears in a "hanged" state and doesn't
respond to its event queue. It seems to work in tk, but I had similar code
with a SOCK_DGRAM that would hang in msw and tk when creating a window after
recv().
Is this a problem with specific backends or creating windows in a thread?
from anygui import *
from threading import *
from socket import *
def socket_accept():
s = socket(AF_INET, SOCK_STREAM)
s.bind(('', 8001))
s.listen(1)
create_window('works here too')
s1 = s.accept()[0]
print 'accepted'
create_window('not working')
def create_window(title):
win = Window(title=title)
btn = Button(text='Click')
win.add(btn)
app.add(win)
app = Application()
t = Thread(None, socket_accept, None, (), {})
t.start()
create_window('works here')
app.run()
_________________________________________________________________
Charla con tus amigos en línea mediante MSN Messenger:
http://messenger.yupimsn.com/
|