window creation doesn't work after some socket calls in msw

"sum trix" <[email protected]> Fri, 09 May 2003 01:38:35 +0000
Newsgroups gmane.comp.python.anygui.general
Message-ID <[email protected]>
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/



-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com