added wxEventLoop::DispatchTimeout()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57571 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -153,3 +153,23 @@ void wxEventLoopManual::Exit(int rc)
|
||||
}
|
||||
|
||||
#endif // __WXMSW__ || __WXMAC__ || __WXDFB__
|
||||
|
||||
#ifdef wxNEEDS_GENERIC_DISPATCH_TIMEOUT
|
||||
|
||||
int wxGUIEventLoop::DispatchTimeout(unsigned long timeout)
|
||||
{
|
||||
// TODO: this is, of course, horribly inefficient and a proper wait with
|
||||
// timeout should be implemented for all ports natively...
|
||||
const wxMilliClock_t timeEnd = wxGetLocalTimeMillis() + timeout;
|
||||
for ( ;; )
|
||||
{
|
||||
if ( Pending() )
|
||||
return Dispatch();
|
||||
|
||||
if ( wxGetLocalTimeMillis() >= timeEnd )
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // wxNEEDS_GENERIC_DISPATCH_TIMEOUT
|
||||
|
||||
|
Reference in New Issue
Block a user