Thank you very much - win32api.MessageBox(0, 'label') works within PythonWin
just fine (see below) so I now have a good solution. I'd followed the
win32ui route from reading PPonWin32 and hadn't really realised that other
options could be more suitable.
Apologies for the mis-abstraction of my main loop. With the win32api
function and the correct abstraction of my main code it reads something
like:
# main
stillRunning = 1
runOk = runOkThread()
runOk.start()
# processing loop
while stillRunning:
# do processing
...
if processingIsOver:
stillRunning = 0
if not runOk.isAlive():
stillRunning = 0
# working win32ui threading class
class runOkThread(threading.Thread):
"""
Pop up a win32ui dialog. When the Ok button is pressed the thread stops.
You CAN use this to stop the app.
"""
def run(self):
dlg = win32api.MessageBox(0, 'Press to stop', 'AppName',
win32con.MB_OK | win32con.MB_TOPMOST)
Geoff
-----Original Message-----
From: Mark Hammond [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 05, 2001 12:03 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Simple thread with win32ui doesn't work as well as with Tk
...
If you are trying to run this from inside Pythonwin, then you probably need
to use the win32api.MessageBox function, passing 0 for the "parent window"
param.
The problem is likely to be that the MFC framework under Pythonwin is trying
to parent the window to the main application frame, and this is a no-no in a
multi-threaded application.
Further, your "main processing loop" appears that it would create an
unlimited number of threads, each attempting their own dialog. However,
without seeing what is in the code you omitted I can not be sure.
...
_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activepython