Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > RE: [python-win32] simulate DoEvents by python/wxpython

Thread Tools

RE: [python-win32] simulate DoEvents by python/wxpython

Mark Hammond
Posts: n/a
Build 205 of win32gui does have PeekMessage etc so you can now write the
message loop in Python should the need arise - however, the various
"PumpMessages" and "PumpWaitingMessages" functions do the same thing, but
are implemented in C. There are versions of these functions in win32gui and
win32ui. win32ui is the MFC wrapper, and its version does do it the "MFC
way", as opposed to the vanilla Windows way that win32gui exposes. Your
code below looks like it is MFC based, so the win32ui versions may work
better for you (eg, work correctly with the MFC idle processing). If you do
truly only need VB DoEvents style processing (which is not MFC aware),
win32gui.Pump(Waiting)Messages should be fine though.

-----Original Message-----
From: Removed)
[mailto(E-Mail Removed)]On Behalf Of James Hu
Sent: Thursday, 27 October 2005 4:10 AM
To: (E-Mail Removed); (E-Mail Removed)
Subject: [python-win32] simulate DoEvents by python/wxpython

Hi, all gurus,

I need to simulate DoEvents in VB by python/wxPython,
My application needs to capture live image in a loop until one specific
button pressed
Multi-thread is also not very good solution, for there are big number of
data to exchange between the two threads.

Win32gui doesn't have PeekMessage.

Or translate the folllowinf codes to python?

MSG msg;
while ( :eekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ) )
if ( !PumpMessage( ) )
:ostQuitMessage( 1 );
return FALSE;
// let MFC do its idle processing
LONG lIdle = 0;
while ( OnIdle(lIdle++ ) )
return TRUE;

Thanks in advance,

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Threading and Application.doEvents()... OziRus Java 4 03-08-2007 12:29 AM
RE: [python-win32] simulate DoEvents by python/wxpython James Hu Python 0 10-27-2005 01:32 PM
DoEvents Equivalent? MichaelR ASP .Net 1 01-24-2005 06:17 PM
DoEvents in ASP? Dennis Eklund ASP General 1 02-08-2004 05:09 PM
simulate virtual directory - I need it urgently Amir Eshterayeh ASP .Net 1 02-05-2004 01:11 PM