1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "app.h"
19 #include "wx/gdicmn.h"
21 #include "wx/dialog.h"
23 #include "wx/module.h"
24 #include "wx/memory.h"
27 #include "wx/evtloop.h"
30 #include "wx/univ/theme.h"
31 #include "wx/univ/renderer.h"
34 #include "wx/thread.h"
37 #if wxUSE_WX_RESOURCES
38 #include "wx/resource.h"
41 #include "wx/x11/private.h"
45 //------------------------------------------------------------------------
47 //------------------------------------------------------------------------
49 extern wxList wxPendingDelete
;
51 wxHashTable
*wxWidgetHashTable
= NULL
;
52 wxHashTable
*wxClientWidgetHashTable
= NULL
;
54 wxApp
*wxTheApp
= NULL
;
56 // This is set within wxEntryStart -- too early on
57 // to put these in wxTheApp
58 static int g_newArgc
= 0;
59 static wxChar
** g_newArgv
= NULL
;
60 static bool g_showIconic
= FALSE
;
61 static wxSize g_initialSize
= wxDefaultSize
;
63 // This is required for wxFocusEvent::SetWindow(). It will only
64 // work for focus events which we provoke ourselves (by calling
65 // SetFocus()). It will not work for those events, which X11
67 static wxWindow
*g_nextFocus
= NULL
;
68 static wxWindow
*g_prevFocus
= NULL
;
70 //------------------------------------------------------------------------
72 //------------------------------------------------------------------------
75 typedef int (*XErrorHandlerFunc
)(Display
*, XErrorEvent
*);
77 XErrorHandlerFunc gs_pfnXErrorHandler
= 0;
79 static int wxXErrorHandler(Display
*dpy
, XErrorEvent
*xevent
)
81 // just forward to the default handler for now
82 if (gs_pfnXErrorHandler
)
83 return gs_pfnXErrorHandler(dpy
, xevent
);
89 //------------------------------------------------------------------------
91 //------------------------------------------------------------------------
93 long wxApp::sm_lastMessageTime
= 0;
94 WXDisplay
*wxApp::ms_display
= NULL
;
96 IMPLEMENT_DYNAMIC_CLASS(wxApp
, wxEvtHandler
)
98 BEGIN_EVENT_TABLE(wxApp
, wxEvtHandler
)
99 EVT_IDLE(wxApp::OnIdle
)
102 bool wxApp::Initialize()
104 wxClassInfo::InitializeClasses();
106 // GL: I'm annoyed ... I don't know where to put this and I don't want to
107 // create a module for that as it's part of the core.
109 wxPendingEventsLocker
= new wxCriticalSection();
112 wxTheColourDatabase
= new wxColourDatabase(wxKEY_STRING
);
113 wxTheColourDatabase
->Initialize();
115 wxInitializeStockLists();
116 wxInitializeStockObjects();
118 #if wxUSE_WX_RESOURCES
119 wxInitializeResourceSystem();
122 wxWidgetHashTable
= new wxHashTable(wxKEY_INTEGER
);
123 wxClientWidgetHashTable
= new wxHashTable(wxKEY_INTEGER
);
125 wxModule::RegisterModules();
126 if (!wxModule::InitializeModules()) return FALSE
;
131 void wxApp::CleanUp()
137 delete wxWidgetHashTable
;
138 wxWidgetHashTable
= NULL
;
139 delete wxClientWidgetHashTable
;
140 wxClientWidgetHashTable
= NULL
;
142 wxModule::CleanUpModules();
144 #if wxUSE_WX_RESOURCES
145 wxCleanUpResourceSystem();
148 delete wxTheColourDatabase
;
149 wxTheColourDatabase
= NULL
;
151 wxDeleteStockObjects();
153 wxDeleteStockLists();
158 wxClassInfo::CleanUpClasses();
161 delete wxPendingEvents
;
162 delete wxPendingEventsLocker
;
165 #if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
166 // At this point we want to check if there are any memory
167 // blocks that aren't part of the wxDebugContext itself,
168 // as a special case. Then when dumping we need to ignore
169 // wxDebugContext, too.
170 if (wxDebugContext::CountObjectsLeft(TRUE
) > 0)
172 wxLogDebug("There were memory leaks.");
173 wxDebugContext::Dump();
174 wxDebugContext::PrintStatistics();
178 // do it as the very last thing because everything else can log messages
179 wxLog::DontCreateOnDemand();
180 // do it as the very last thing because everything else can log messages
181 delete wxLog::SetActiveTarget(NULL
);
184 // NB: argc and argv may be changed here, pass by reference!
185 int wxEntryStart( int& argc
, char *argv
[] )
189 // install the X error handler
190 gs_pfnXErrorHandler
= XSetErrorHandler( wxXErrorHandler
);
192 #endif // __WXDEBUG__
194 wxString displayName
;
195 bool syncDisplay
= FALSE
;
197 // Parse the arguments.
198 // We can't use wxCmdLineParser or OnInitCmdLine and friends because
199 // we have to create the Display earlier. If we can find a way to
200 // use the wxAppBase API then I'll be quite happy to change it.
201 g_newArgv
= new wxChar
*[argc
];
204 for (i
= 0; i
< argc
; i
++)
206 wxString
arg(argv
[i
]);
207 if (arg
== wxT("-display"))
212 displayName
= argv
[i
];
216 else if (arg
== wxT("-geometry"))
221 wxString windowGeometry
= argv
[i
];
223 if (wxSscanf(windowGeometry
.c_str(), _T("%dx%d"), &w
, &h
) != 2)
225 wxLogError(_("Invalid geometry specification '%s'"), windowGeometry
.c_str());
229 g_initialSize
= wxSize(w
, h
);
234 else if (arg
== wxT("-sync"))
239 else if (arg
== wxT("-iconic"))
246 // Not eaten by wxWindows, so pass through
247 g_newArgv
[g_newArgc
] = argv
[i
];
251 Display
* xdisplay
= NULL
;
252 if (displayName
.IsEmpty())
253 xdisplay
= XOpenDisplay(NULL
);
255 xdisplay
= XOpenDisplay((char*) displayName
.c_str());
259 wxLogError( _("wxWindows could not open display. Exiting.") );
265 XSynchronize(xdisplay
, True
);
268 wxApp::ms_display
= (WXDisplay
*) xdisplay
;
270 XSelectInput( xdisplay
, XDefaultRootWindow(xdisplay
), PropertyChangeMask
);
272 wxSetDetectableAutoRepeat( TRUE
);
274 if (!wxApp::Initialize())
284 if ( !wxTheApp
->OnInitGui() )
291 int wxEntry( int argc
, char *argv
[] )
293 #if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
294 // This seems to be necessary since there are 'rogue'
295 // objects present at this point (perhaps global objects?)
296 // Setting a checkpoint will ignore them as far as the
297 // memory checking facility is concerned.
298 // Of course you may argue that memory allocated in globals should be
299 // checked, but this is a reasonable compromise.
300 wxDebugContext::SetCheckpoint();
302 int err
= wxEntryStart(argc
, argv
);
308 if (!wxApp::GetInitializerFunction())
310 printf( "wxWindows error: No initializer - use IMPLEMENT_APP macro.\n" );
314 wxTheApp
= (wxApp
*) (* wxApp::GetInitializerFunction()) ();
319 printf( "wxWindows error: wxTheApp == NULL\n" );
323 wxTheApp
->SetClassName(wxFileNameFromPath(argv
[0]));
324 wxTheApp
->SetAppName(wxFileNameFromPath(argv
[0]));
326 // The command line may have been changed
327 // by stripping out -display etc.
330 wxTheApp
->argc
= g_newArgc
;
331 wxTheApp
->argv
= g_newArgv
;
335 wxTheApp
->argc
= argc
;
336 wxTheApp
->argv
= argv
;
338 wxTheApp
->m_showIconic
= g_showIconic
;
339 wxTheApp
->m_initialSize
= g_initialSize
;
342 retValue
= wxEntryInitGui();
344 // Here frames insert themselves automatically into wxTopLevelWindows by
345 // getting created in OnInit().
348 if ( !wxTheApp
->OnInit() )
354 if (wxTheApp
->Initialized()) retValue
= wxTheApp
->OnRun();
357 // flush the logged messages if any
358 wxLog
*pLog
= wxLog::GetActiveTarget();
359 if ( pLog
!= NULL
&& pLog
->HasPendingMessages() )
362 delete wxLog::SetActiveTarget(new wxLogStderr
); // So dialog boxes aren't used
363 // for further messages
365 if (wxTheApp
->GetTopWindow())
367 delete wxTheApp
->GetTopWindow();
368 wxTheApp
->SetTopWindow(NULL
);
371 wxTheApp
->DeletePendingObjects();
380 // Static member initialization
381 wxAppInitializerFunction
wxAppBase::m_appInitFn
= (wxAppInitializerFunction
) NULL
;
388 m_wantDebugOutput
= TRUE
;
392 m_exitOnFrameDelete
= TRUE
;
393 m_mainColormap
= (WXColormap
) NULL
;
394 m_topLevelWidget
= (WXWindow
) NULL
;
395 m_maxRequestSize
= 0;
397 m_showIconic
= FALSE
;
398 m_initialSize
= wxDefaultSize
;
401 bool wxApp::Initialized()
409 int wxApp::MainLoop()
412 m_mainLoop
= new wxEventLoop
;
414 rt
= m_mainLoop
->Run();
422 //-----------------------------------------------------------------------
423 // X11 predicate function for exposure compression
424 //-----------------------------------------------------------------------
429 Bool found_non_matching
;
432 static Bool
expose_predicate (Display
*display
, XEvent
*xevent
, XPointer arg
)
434 wxExposeInfo
*info
= (wxExposeInfo
*) arg
;
436 if (info
->found_non_matching
)
439 if (xevent
->xany
.type
!= Expose
)
441 info
->found_non_matching
= TRUE
;
445 if (xevent
->xexpose
.window
!= info
->window
)
447 info
->found_non_matching
= TRUE
;
456 //-----------------------------------------------------------------------
457 // Processes an X event, returning TRUE if the event was processed.
458 //-----------------------------------------------------------------------
460 bool wxApp::ProcessXEvent(WXEvent
* _event
)
462 XEvent
* event
= (XEvent
*) _event
;
464 wxWindow
* win
= NULL
;
465 Window window
= XEventGetWindow(event
);
467 Window actualWindow
= window
;
470 // Find the first wxWindow that corresponds to this event window
471 // Because we're receiving events after a window
472 // has been destroyed, assume a 1:1 match between
473 // Window and wxWindow, so if it's not in the table,
474 // it must have been destroyed.
476 win
= wxGetWindowFromTable(window
);
479 #if wxUSE_TWO_WINDOWS
480 win
= wxGetClientWindowFromTable(window
);
487 wxString windowClass
= win
->GetClassInfo()->GetClassName();
494 #if wxUSE_TWO_WINDOWS
495 if (event
->xexpose
.window
!= (Window
)win
->GetClientWindow())
499 info
.window
= event
->xexpose
.window
;
500 info
.found_non_matching
= FALSE
;
501 while (XCheckIfEvent( wxGlobalDisplay(), &tmp_event
, expose_predicate
, (XPointer
) &info
))
503 // Don't worry about optimizing redrawing the border etc.
505 win
->NeedUpdateNcAreaInIdle();
510 win
->GetUpdateRegion().Union( XExposeEventGetX(event
), XExposeEventGetY(event
),
511 XExposeEventGetWidth(event
), XExposeEventGetHeight(event
));
512 win
->GetClearRegion().Union( XExposeEventGetX(event
), XExposeEventGetY(event
),
513 XExposeEventGetWidth(event
), XExposeEventGetHeight(event
));
518 info
.window
= event
->xexpose
.window
;
519 info
.found_non_matching
= FALSE
;
520 while (XCheckIfEvent( wxGlobalDisplay(), &tmp_event
, expose_predicate
, (XPointer
) &info
))
522 win
->GetUpdateRegion().Union( tmp_event
.xexpose
.x
, tmp_event
.xexpose
.y
,
523 tmp_event
.xexpose
.width
, tmp_event
.xexpose
.height
);
525 win
->GetClearRegion().Union( tmp_event
.xexpose
.x
, tmp_event
.xexpose
.y
,
526 tmp_event
.xexpose
.width
, tmp_event
.xexpose
.height
);
530 // This simplifies the expose and clear areas to simple
532 win
->GetUpdateRegion() = win
->GetUpdateRegion().GetBox();
533 win
->GetClearRegion() = win
->GetClearRegion().GetBox();
535 // If we only have one X11 window, always indicate
536 // that borders might have to be redrawn.
537 if (win
->GetMainWindow() == win
->GetClientWindow())
538 win
->NeedUpdateNcAreaInIdle();
540 // Only erase background, paint in idle time.
541 win
->SendEraseEvents();
551 // wxLogDebug( "GraphicsExpose from %s", win->GetName().c_str(),
552 // event->xgraphicsexpose.x, event->xgraphicsexpose.y,
553 // event->xgraphicsexpose.width, event->xgraphicsexpose.height);
555 win
->GetUpdateRegion().Union( event
->xgraphicsexpose
.x
, event
->xgraphicsexpose
.y
,
556 event
->xgraphicsexpose
.width
, event
->xgraphicsexpose
.height
);
558 win
->GetClearRegion().Union( event
->xgraphicsexpose
.x
, event
->xgraphicsexpose
.y
,
559 event
->xgraphicsexpose
.width
, event
->xgraphicsexpose
.height
);
561 if (event
->xgraphicsexpose
.count
== 0)
563 // Only erase background, paint in idle time.
564 win
->SendEraseEvents();
574 if (!win
->IsEnabled())
577 wxKeyEvent
keyEvent(wxEVT_KEY_DOWN
);
578 wxTranslateKeyEvent(keyEvent
, win
, window
, event
);
580 // wxLogDebug( "OnKey from %s", win->GetName().c_str() );
582 // We didn't process wxEVT_KEY_DOWN, so send wxEVT_CHAR
583 if (win
->GetEventHandler()->ProcessEvent( keyEvent
))
586 keyEvent
.SetEventType(wxEVT_CHAR
);
587 if (win
->GetEventHandler()->ProcessEvent( keyEvent
))
590 if ( (keyEvent
.m_keyCode
== WXK_TAB
) &&
591 win
->GetParent() && (win
->GetParent()->HasFlag( wxTAB_TRAVERSAL
)) )
593 wxNavigationKeyEvent new_event
;
594 new_event
.SetEventObject( win
->GetParent() );
595 /* GDK reports GDK_ISO_Left_Tab for SHIFT-TAB */
596 new_event
.SetDirection( (keyEvent
.m_keyCode
== WXK_TAB
) );
597 /* CTRL-TAB changes the (parent) window, i.e. switch notebook page */
598 new_event
.SetWindowChange( keyEvent
.ControlDown() );
599 new_event
.SetCurrentFocus( win
);
600 return win
->GetParent()->GetEventHandler()->ProcessEvent( new_event
);
607 if (!win
->IsEnabled())
610 wxKeyEvent
keyEvent(wxEVT_KEY_UP
);
611 wxTranslateKeyEvent(keyEvent
, win
, window
, event
);
613 return win
->GetEventHandler()->ProcessEvent( keyEvent
);
615 case ConfigureNotify
:
618 if (event
->update
.utype
== GR_UPDATE_SIZE
)
621 if (win
->IsTopLevel())
623 wxTopLevelWindow
*tlw
= (wxTopLevelWindow
*) win
;
624 tlw
->SetConfigureGeometry( XConfigureEventGetX(event
), XConfigureEventGetY(event
),
625 XConfigureEventGetWidth(event
), XConfigureEventGetHeight(event
) );
628 if (win
->IsTopLevel() && win
->IsShown())
630 wxTopLevelWindowX11
*tlw
= (wxTopLevelWindowX11
*) win
;
631 tlw
->SetNeedResizeInIdle();
635 wxSizeEvent
sizeEvent( wxSize(XConfigureEventGetWidth(event
), XConfigureEventGetHeight(event
)), win
->GetId() );
636 sizeEvent
.SetEventObject( win
);
638 return win
->GetEventHandler()->ProcessEvent( sizeEvent
);
647 //wxLogDebug("PropertyNotify: %s", windowClass.c_str());
648 return HandlePropertyChange(_event
);
652 if (!win
->IsEnabled())
655 Atom wm_delete_window
= XInternAtom(wxGlobalDisplay(), "WM_DELETE_WINDOW", True
);
656 Atom wm_protocols
= XInternAtom(wxGlobalDisplay(), "WM_PROTOCOLS", True
);
658 if (event
->xclient
.message_type
== wm_protocols
)
660 if ((Atom
) (event
->xclient
.data
.l
[0]) == wm_delete_window
)
671 printf( "destroy from %s\n", win
->GetName().c_str() );
676 printf( "create from %s\n", win
->GetName().c_str() );
681 printf( "map request from %s\n", win
->GetName().c_str() );
686 printf( "resize request from %s\n", win
->GetName().c_str() );
688 Display
*disp
= (Display
*) wxGetDisplay();
693 while( XCheckTypedWindowEvent (disp
, actualWindow
, ResizeRequest
, &report
));
695 wxSize sz
= win
->GetSize();
696 wxSizeEvent
sizeEvent(sz
, win
->GetId());
697 sizeEvent
.SetEventObject(win
);
699 return win
->GetEventHandler()->ProcessEvent( sizeEvent
);
704 case GR_EVENT_TYPE_CLOSE_REQ
:
721 if (!win
->IsEnabled())
724 // Here we check if the top level window is
725 // disabled, which is one aspect of modality.
727 while (tlw
&& !tlw
->IsTopLevel())
728 tlw
= tlw
->GetParent();
729 if (tlw
&& !tlw
->IsEnabled())
732 if (event
->type
== ButtonPress
)
734 if ((win
!= wxWindow::FindFocus()) && win
->AcceptsFocus())
736 // This might actually be done in wxWindow::SetFocus()
737 // and not here. TODO.
738 g_prevFocus
= wxWindow::FindFocus();
746 if (event
->type
== LeaveNotify
|| event
->type
== EnterNotify
)
748 // Throw out NotifyGrab and NotifyUngrab
749 if (event
->xcrossing
.mode
!= NotifyNormal
)
753 wxMouseEvent wxevent
;
754 wxTranslateMouseEvent(wxevent
, win
, window
, event
);
755 return win
->GetEventHandler()->ProcessEvent( wxevent
);
760 if ((event
->xfocus
.detail
!= NotifyPointer
) &&
761 (event
->xfocus
.mode
== NotifyNormal
))
764 // wxLogDebug( "FocusIn from %s of type %s", win->GetName().c_str(), win->GetClassInfo()->GetClassName() );
766 wxFocusEvent
focusEvent(wxEVT_SET_FOCUS
, win
->GetId());
767 focusEvent
.SetEventObject(win
);
768 focusEvent
.SetWindow( g_prevFocus
);
771 return win
->GetEventHandler()->ProcessEvent(focusEvent
);
779 if ((event
->xfocus
.detail
!= NotifyPointer
) &&
780 (event
->xfocus
.mode
== NotifyNormal
))
783 // wxLogDebug( "FocusOut from %s of type %s", win->GetName().c_str(), win->GetClassInfo()->GetClassName() );
785 wxFocusEvent
focusEvent(wxEVT_KILL_FOCUS
, win
->GetId());
786 focusEvent
.SetEventObject(win
);
787 focusEvent
.SetWindow( g_nextFocus
);
789 return win
->GetEventHandler()->ProcessEvent(focusEvent
);
797 //wxString eventName = wxGetXEventName(XEvent& event);
798 //wxLogDebug(wxT("Event %s not handled"), eventName.c_str());
807 // Returns TRUE if more time is needed.
808 // Note that this duplicates wxEventLoopImpl::SendIdleEvent
809 // but ProcessIdle may be needed by apps, so is kept.
810 bool wxApp::ProcessIdle()
813 event
.SetEventObject(this);
816 return event
.MoreRequested();
819 void wxApp::ExitMainLoop()
825 // Is a message/event pending?
826 bool wxApp::Pending()
828 return wxEventLoop::GetActive()->Pending();
831 // Dispatch a message.
832 void wxApp::Dispatch()
834 wxEventLoop::GetActive()->Dispatch();
837 // This should be redefined in a derived class for
838 // handling property change events for XAtom IPC.
839 bool wxApp::HandlePropertyChange(WXEvent
*event
)
841 // by default do nothing special
842 // TODO: what to do for X11
843 // XtDispatchEvent((XEvent*) event);
847 void wxApp::OnIdle(wxIdleEvent
& event
)
849 static bool s_inOnIdle
= FALSE
;
851 // Avoid recursion (via ProcessEvent default case)
857 // Resend in the main thread events which have been prepared in other
859 ProcessPendingEvents();
861 // 'Garbage' collection of windows deleted with Close()
862 DeletePendingObjects();
864 // Send OnIdle events to all windows
865 bool needMore
= SendIdleEvents();
868 event
.RequestMore(TRUE
);
875 // **** please implement me! ****
876 // Wake up the idle handler processor, even if it is in another thread...
880 // Send idle event to all top-level windows
881 bool wxApp::SendIdleEvents()
883 bool needMore
= FALSE
;
885 wxWindowList::Node
* node
= wxTopLevelWindows
.GetFirst();
888 wxWindow
* win
= node
->GetData();
889 if (SendIdleEvents(win
))
891 node
= node
->GetNext();
897 // Send idle event to window and all subwindows
898 bool wxApp::SendIdleEvents(wxWindow
* win
)
900 bool needMore
= FALSE
;
903 event
.SetEventObject(win
);
905 win
->GetEventHandler()->ProcessEvent(event
);
907 win
->OnInternalIdle();
909 if (event
.MoreRequested())
912 wxNode
* node
= win
->GetChildren().First();
915 wxWindow
* win
= (wxWindow
*) node
->Data();
916 if (SendIdleEvents(win
))
925 void wxApp::DeletePendingObjects()
927 wxNode
*node
= wxPendingDelete
.First();
930 wxObject
*obj
= (wxObject
*)node
->Data();
934 if (wxPendingDelete
.Member(obj
))
937 // Deleting one object may have deleted other pending
938 // objects, so start from beginning of list again.
939 node
= wxPendingDelete
.First();
943 // Create display, and other initialization
944 bool wxApp::OnInitGui()
946 // Eventually this line will be removed, but for
947 // now we don't want to try popping up a dialog
948 // for error messages.
949 delete wxLog::SetActiveTarget(new wxLogStderr
);
951 if (!wxAppBase::OnInitGui())
954 GetMainColormap( wxApp::GetDisplay() );
956 m_maxRequestSize
= XMaxRequestSize( (Display
*) wxApp::GetDisplay() );
961 WXColormap
wxApp::GetMainColormap(WXDisplay
* display
)
963 if (!display
) /* Must be called first with non-NULL display */
964 return m_mainColormap
;
966 int defaultScreen
= DefaultScreen((Display
*) display
);
967 Screen
* screen
= XScreenOfDisplay((Display
*) display
, defaultScreen
);
969 Colormap c
= DefaultColormapOfScreen(screen
);
972 m_mainColormap
= (WXColormap
) c
;
974 return (WXColormap
) c
;
977 Window
wxGetWindowParent(Window window
)
979 wxASSERT_MSG( window
, "invalid window" );
983 Window parent
, root
= 0;
987 unsigned int noChildren
= 0;
989 Window
* children
= NULL
;
991 // #define XQueryTree(d,w,r,p,c,nc) GrQueryTree(w,p,c,nc)
996 XQueryTree((Display
*) wxGetDisplay(), window
, & root
, & parent
,
997 & children
, & noChildren
);
1010 retValue
= wxTheApp
->OnExit();
1014 * Exit in some platform-specific way. Not recommended that the app calls this:
1015 * only for emergencies.
1020 // Yield to other processes
1022 bool wxApp::Yield(bool onlyIfNeeded
)
1024 bool s_inYield
= FALSE
;
1028 if ( !onlyIfNeeded
)
1030 wxFAIL_MSG( wxT("wxYield called recursively" ) );
1038 // Make sure we have an event loop object,
1039 // or Pending/Dispatch will fail
1040 wxEventLoop
* eventLoop
= wxEventLoop::GetActive();
1041 wxEventLoop
* newEventLoop
= NULL
;
1044 newEventLoop
= new wxEventLoop
;
1045 wxEventLoop::SetActive(newEventLoop
);
1048 while (wxTheApp
&& wxTheApp
->Pending())
1049 wxTheApp
->Dispatch();
1052 wxTimer::NotifyTimers();
1058 wxEventLoop::SetActive(NULL
);
1059 delete newEventLoop
;
1067 void wxApp::OnAssert(const wxChar
*file
, int line
, const wxChar
*msg
)
1069 // While the GUI isn't working that well, just print out the
1072 wxAppBase::OnAssert(file
, line
, msg
);
1075 msg2
.Printf("At file %s:%d: %s", file
, line
, msg
);