Fixed gtk 1.2.x wxYield() problem (tested).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2072 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
7cf8333086
commit
53a8af592a
@ -120,6 +120,10 @@ class wxApp: public wxEvtHandler
|
|||||||
#endif
|
#endif
|
||||||
void DeletePendingObjects();
|
void DeletePendingObjects();
|
||||||
|
|
||||||
|
/// This can be used to suppress the generation of Idle events.
|
||||||
|
inline void SuppressIdleEvents(bool arg = TRUE) { m_suppressIdleEvents = arg; }
|
||||||
|
inline bool GetSuppressIdleEvents() const { return m_suppressIdleEvents; }
|
||||||
|
|
||||||
bool m_initialized;
|
bool m_initialized;
|
||||||
bool m_exitOnFrameDelete;
|
bool m_exitOnFrameDelete;
|
||||||
bool m_wantDebugOutput;
|
bool m_wantDebugOutput;
|
||||||
@ -136,7 +140,9 @@ class wxApp: public wxEvtHandler
|
|||||||
wxString m_className;
|
wxString m_className;
|
||||||
|
|
||||||
static wxAppInitializerFunction m_appInitFn;
|
static wxAppInitializerFunction m_appInitFn;
|
||||||
|
private:
|
||||||
|
/// Set to TRUE while we are in wxYield().
|
||||||
|
bool m_suppressIdleEvents;
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -120,6 +120,10 @@ class wxApp: public wxEvtHandler
|
|||||||
#endif
|
#endif
|
||||||
void DeletePendingObjects();
|
void DeletePendingObjects();
|
||||||
|
|
||||||
|
/// This can be used to suppress the generation of Idle events.
|
||||||
|
inline void SuppressIdleEvents(bool arg = TRUE) { m_suppressIdleEvents = arg; }
|
||||||
|
inline bool GetSuppressIdleEvents() const { return m_suppressIdleEvents; }
|
||||||
|
|
||||||
bool m_initialized;
|
bool m_initialized;
|
||||||
bool m_exitOnFrameDelete;
|
bool m_exitOnFrameDelete;
|
||||||
bool m_wantDebugOutput;
|
bool m_wantDebugOutput;
|
||||||
@ -136,7 +140,9 @@ class wxApp: public wxEvtHandler
|
|||||||
wxString m_className;
|
wxString m_className;
|
||||||
|
|
||||||
static wxAppInitializerFunction m_appInitFn;
|
static wxAppInitializerFunction m_appInitFn;
|
||||||
|
private:
|
||||||
|
/// Set to TRUE while we are in wxYield().
|
||||||
|
bool m_suppressIdleEvents;
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -135,6 +135,9 @@ void wxExit()
|
|||||||
gtk_main_quit();
|
gtk_main_quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// forward decl
|
||||||
|
gint wxapp_idle_callback( gpointer WXUNUSED(data) );
|
||||||
|
|
||||||
bool wxYield()
|
bool wxYield()
|
||||||
{
|
{
|
||||||
// it's necessary to call ProcessIdle() to update the frames sizes which
|
// it's necessary to call ProcessIdle() to update the frames sizes which
|
||||||
@ -148,9 +151,14 @@ bool wxYield()
|
|||||||
win->OnInternalIdle();
|
win->OnInternalIdle();
|
||||||
}
|
}
|
||||||
|
|
||||||
while (gtk_events_pending() > 0)
|
// We need to temporarily remove idle callbacks or the loop will
|
||||||
|
// never finish.
|
||||||
|
gtk_idle_remove( wxTheApp->m_idleTag );
|
||||||
|
|
||||||
|
while (gtk_events_pending())
|
||||||
gtk_main_iteration();
|
gtk_main_iteration();
|
||||||
|
|
||||||
|
wxTheApp->m_idleTag = gtk_idle_add( wxapp_idle_callback, (gpointer) NULL );
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,6 +135,9 @@ void wxExit()
|
|||||||
gtk_main_quit();
|
gtk_main_quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// forward decl
|
||||||
|
gint wxapp_idle_callback( gpointer WXUNUSED(data) );
|
||||||
|
|
||||||
bool wxYield()
|
bool wxYield()
|
||||||
{
|
{
|
||||||
// it's necessary to call ProcessIdle() to update the frames sizes which
|
// it's necessary to call ProcessIdle() to update the frames sizes which
|
||||||
@ -148,9 +151,14 @@ bool wxYield()
|
|||||||
win->OnInternalIdle();
|
win->OnInternalIdle();
|
||||||
}
|
}
|
||||||
|
|
||||||
while (gtk_events_pending() > 0)
|
// We need to temporarily remove idle callbacks or the loop will
|
||||||
|
// never finish.
|
||||||
|
gtk_idle_remove( wxTheApp->m_idleTag );
|
||||||
|
|
||||||
|
while (gtk_events_pending())
|
||||||
gtk_main_iteration();
|
gtk_main_iteration();
|
||||||
|
|
||||||
|
wxTheApp->m_idleTag = gtk_idle_add( wxapp_idle_callback, (gpointer) NULL );
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user