+
+void MyFrame::OnIdle(wxIdleEvent& event)
+{
+ // This code is useful for debugging focus problems
+ // (which are plentiful when dealing with popup windows).
+#if 0
+ static wxWindow* lastFocus = (wxWindow*) NULL;
+
+ wxWindow* curFocus = ::wxWindow::FindFocus();
+
+ if ( curFocus != lastFocus )
+ {
+ const wxChar* className = wxT("<none>");
+ if ( curFocus )
+ className = curFocus->GetClassInfo()->GetClassName();
+ lastFocus = curFocus;
+ wxLogDebug( wxT("FOCUSED: %s %X"),
+ className,
+ (unsigned int)curFocus);
+ }
+#endif
+
+ event.Skip();
+}