Don't allow concurrent requests, check return message of async request

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57518 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2008-12-23 20:46:46 +00:00
parent aace2c4f96
commit b47056410d
2 changed files with 15 additions and 3 deletions

View File

@@ -27,7 +27,7 @@
#endif
#define USE_ASYNCHRONOUS_CLIPBOARD_REQUEST 0
#define USE_ASYNCHRONOUS_CLIPBOARD_REQUEST 1
class MyApp : public wxApp
{
@@ -167,7 +167,12 @@ void MyFrame::OnUpdateUI(wxUpdateUIEvent&event)
#if USE_ASYNCHRONOUS_CLIPBOARD_REQUEST
if (m_request == Idle)
{
wxTheClipboard->IsSupportedAsync( this );
if (!wxTheClipboard->IsSupportedAsync( this ))
{
// request failed, try again later
event.Enable( m_clipboardSupportsText ); // not yet known, assume last value
return;
}
m_request = Waiting;
event.Enable( m_clipboardSupportsText ); // not yet known, assume last value
}