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
);
466 Window actualWindow
= window
;
468 // Find the first wxWindow that corresponds to this event window
469 // Because we're receiving events after a window
470 // has been destroyed, assume a 1:1 match between
471 // Window and wxWindow, so if it's not in the table,
472 // it must have been destroyed.
474 win
= wxGetWindowFromTable(window
);
477 #if wxUSE_TWO_WINDOWS
478 win
= wxGetClientWindowFromTable(window
);
485 wxString windowClass
= win
->GetClassInfo()->GetClassName();
492 #if wxUSE_TWO_WINDOWS
493 if (event
->xexpose
.window
!= (Window
)win
->GetClientWindow())
497 info
.window
= event
->xexpose
.window
;
498 info
.found_non_matching
= FALSE
;
499 while (XCheckIfEvent( wxGlobalDisplay(), &tmp_event
, expose_predicate
, (XPointer
) &info
))
501 // Don't worry about optimizing redrawing the border etc.
503 win
->NeedUpdateNcAreaInIdle();
508 win
->GetUpdateRegion().Union( XExposeEventGetX(event
), XExposeEventGetY(event
),
509 XExposeEventGetWidth(event
), XExposeEventGetHeight(event
));
510 win
->GetClearRegion().Union( XExposeEventGetX(event
), XExposeEventGetY(event
),
511 XExposeEventGetWidth(event
), XExposeEventGetHeight(event
));
516 info
.window
= event
->xexpose
.window
;
517 info
.found_non_matching
= FALSE
;
518 while (XCheckIfEvent( wxGlobalDisplay(), &tmp_event
, expose_predicate
, (XPointer
) &info
))
520 win
->GetUpdateRegion().Union( tmp_event
.xexpose
.x
, tmp_event
.xexpose
.y
,
521 tmp_event
.xexpose
.width
, tmp_event
.xexpose
.height
);
523 win
->GetClearRegion().Union( tmp_event
.xexpose
.x
, tmp_event
.xexpose
.y
,
524 tmp_event
.xexpose
.width
, tmp_event
.xexpose
.height
);
528 // This simplifies the expose and clear areas to simple
530 win
->GetUpdateRegion() = win
->GetUpdateRegion().GetBox();
531 win
->GetClearRegion() = win
->GetClearRegion().GetBox();
533 // If we only have one X11 window, always indicate
534 // that borders might have to be redrawn.
535 if (win
->GetMainWindow() == win
->GetClientWindow())
536 win
->NeedUpdateNcAreaInIdle();
538 // Only erase background, paint in idle time.
539 win
->SendEraseEvents();
549 // wxLogDebug( "GraphicsExpose from %s", win->GetName().c_str(),
550 // event->xgraphicsexpose.x, event->xgraphicsexpose.y,
551 // event->xgraphicsexpose.width, event->xgraphicsexpose.height);
553 win
->GetUpdateRegion().Union( event
->xgraphicsexpose
.x
, event
->xgraphicsexpose
.y
,
554 event
->xgraphicsexpose
.width
, event
->xgraphicsexpose
.height
);
556 win
->GetClearRegion().Union( event
->xgraphicsexpose
.x
, event
->xgraphicsexpose
.y
,
557 event
->xgraphicsexpose
.width
, event
->xgraphicsexpose
.height
);
559 if (event
->xgraphicsexpose
.count
== 0)
561 // Only erase background, paint in idle time.
562 win
->SendEraseEvents();
572 if (!win
->IsEnabled())
575 wxKeyEvent
keyEvent(wxEVT_KEY_DOWN
);
576 wxTranslateKeyEvent(keyEvent
, win
, window
, event
);
578 // wxLogDebug( "OnKey from %s", win->GetName().c_str() );
580 // We didn't process wxEVT_KEY_DOWN, so send wxEVT_CHAR
581 if (win
->GetEventHandler()->ProcessEvent( keyEvent
))
584 keyEvent
.SetEventType(wxEVT_CHAR
);
585 if (win
->GetEventHandler()->ProcessEvent( keyEvent
))
588 if ( (keyEvent
.m_keyCode
== WXK_TAB
) &&
589 win
->GetParent() && (win
->GetParent()->HasFlag( wxTAB_TRAVERSAL
)) )
591 wxNavigationKeyEvent new_event
;
592 new_event
.SetEventObject( win
->GetParent() );
593 /* GDK reports GDK_ISO_Left_Tab for SHIFT-TAB */
594 new_event
.SetDirection( (keyEvent
.m_keyCode
== WXK_TAB
) );
595 /* CTRL-TAB changes the (parent) window, i.e. switch notebook page */
596 new_event
.SetWindowChange( keyEvent
.ControlDown() );
597 new_event
.SetCurrentFocus( win
);
598 return win
->GetParent()->GetEventHandler()->ProcessEvent( new_event
);
605 if (!win
->IsEnabled())
608 wxKeyEvent
keyEvent(wxEVT_KEY_UP
);
609 wxTranslateKeyEvent(keyEvent
, win
, window
, event
);
611 return win
->GetEventHandler()->ProcessEvent( keyEvent
);
613 case ConfigureNotify
:
616 if (event
->update
.utype
== GR_UPDATE_SIZE
)
619 if (win
->IsTopLevel())
621 wxTopLevelWindow
*tlw
= (wxTopLevelWindow
*) win
;
622 tlw
->SetConfigureGeometry( XConfigureEventGetX(event
), XConfigureEventGetY(event
),
623 XConfigureEventGetWidth(event
), XConfigureEventGetHeight(event
) );
626 if (win
->IsTopLevel() && win
->IsShown())
628 wxTopLevelWindowX11
*tlw
= (wxTopLevelWindowX11
*) win
;
629 tlw
->SetNeedResizeInIdle();
633 wxSizeEvent
sizeEvent( wxSize(XConfigureEventGetWidth(event
), XConfigureEventGetHeight(event
)), win
->GetId() );
634 sizeEvent
.SetEventObject( win
);
636 return win
->GetEventHandler()->ProcessEvent( sizeEvent
);
645 //wxLogDebug("PropertyNotify: %s", windowClass.c_str());
646 return HandlePropertyChange(_event
);
650 if (!win
->IsEnabled())
653 Atom wm_delete_window
= XInternAtom(wxGlobalDisplay(), "WM_DELETE_WINDOW", True
);
654 Atom wm_protocols
= XInternAtom(wxGlobalDisplay(), "WM_PROTOCOLS", True
);
656 if (event
->xclient
.message_type
== wm_protocols
)
658 if ((Atom
) (event
->xclient
.data
.l
[0]) == wm_delete_window
)
669 printf( "destroy from %s\n", win
->GetName().c_str() );
674 printf( "create from %s\n", win
->GetName().c_str() );
679 printf( "map request from %s\n", win
->GetName().c_str() );
684 printf( "resize request from %s\n", win
->GetName().c_str() );
686 Display
*disp
= (Display
*) wxGetDisplay();
691 while( XCheckTypedWindowEvent (disp
, actualWindow
, ResizeRequest
, &report
));
693 wxSize sz
= win
->GetSize();
694 wxSizeEvent
sizeEvent(sz
, win
->GetId());
695 sizeEvent
.SetEventObject(win
);
697 return win
->GetEventHandler()->ProcessEvent( sizeEvent
);
702 case GR_EVENT_TYPE_CLOSE_REQ
:
719 if (!win
->IsEnabled())
722 // Here we check if the top level window is
723 // disabled, which is one aspect of modality.
725 while (tlw
&& !tlw
->IsTopLevel())
726 tlw
= tlw
->GetParent();
727 if (tlw
&& !tlw
->IsEnabled())
730 if (event
->type
== ButtonPress
)
732 if ((win
!= wxWindow::FindFocus()) && win
->AcceptsFocus())
734 // This might actually be done in wxWindow::SetFocus()
735 // and not here. TODO.
736 g_prevFocus
= wxWindow::FindFocus();
744 if (event
->type
== LeaveNotify
|| event
->type
== EnterNotify
)
746 // Throw out NotifyGrab and NotifyUngrab
747 if (event
->xcrossing
.mode
!= NotifyNormal
)
751 wxMouseEvent wxevent
;
752 wxTranslateMouseEvent(wxevent
, win
, window
, event
);
753 return win
->GetEventHandler()->ProcessEvent( wxevent
);
758 if ((event
->xfocus
.detail
!= NotifyPointer
) &&
759 (event
->xfocus
.mode
== NotifyNormal
))
762 // wxLogDebug( "FocusIn from %s of type %s", win->GetName().c_str(), win->GetClassInfo()->GetClassName() );
764 wxFocusEvent
focusEvent(wxEVT_SET_FOCUS
, win
->GetId());
765 focusEvent
.SetEventObject(win
);
766 focusEvent
.SetWindow( g_prevFocus
);
769 return win
->GetEventHandler()->ProcessEvent(focusEvent
);
777 if ((event
->xfocus
.detail
!= NotifyPointer
) &&
778 (event
->xfocus
.mode
== NotifyNormal
))
781 // wxLogDebug( "FocusOut from %s of type %s", win->GetName().c_str(), win->GetClassInfo()->GetClassName() );
783 wxFocusEvent
focusEvent(wxEVT_KILL_FOCUS
, win
->GetId());
784 focusEvent
.SetEventObject(win
);
785 focusEvent
.SetWindow( g_nextFocus
);
787 return win
->GetEventHandler()->ProcessEvent(focusEvent
);
795 //wxString eventName = wxGetXEventName(XEvent& event);
796 //wxLogDebug(wxT("Event %s not handled"), eventName.c_str());
805 // Returns TRUE if more time is needed.
806 // Note that this duplicates wxEventLoopImpl::SendIdleEvent
807 // but ProcessIdle may be needed by apps, so is kept.
808 bool wxApp::ProcessIdle()
811 event
.SetEventObject(this);
814 return event
.MoreRequested();
817 void wxApp::ExitMainLoop()
823 // Is a message/event pending?
824 bool wxApp::Pending()
826 return wxEventLoop::GetActive()->Pending();
829 // Dispatch a message.
830 void wxApp::Dispatch()
832 wxEventLoop::GetActive()->Dispatch();
835 // This should be redefined in a derived class for
836 // handling property change events for XAtom IPC.
837 bool wxApp::HandlePropertyChange(WXEvent
*event
)
839 // by default do nothing special
840 // TODO: what to do for X11
841 // XtDispatchEvent((XEvent*) event);
845 void wxApp::OnIdle(wxIdleEvent
& event
)
847 static bool s_inOnIdle
= FALSE
;
849 // Avoid recursion (via ProcessEvent default case)
855 // Resend in the main thread events which have been prepared in other
857 ProcessPendingEvents();
859 // 'Garbage' collection of windows deleted with Close()
860 DeletePendingObjects();
862 // Send OnIdle events to all windows
863 bool needMore
= SendIdleEvents();
866 event
.RequestMore(TRUE
);
873 // **** please implement me! ****
874 // Wake up the idle handler processor, even if it is in another thread...
878 // Send idle event to all top-level windows
879 bool wxApp::SendIdleEvents()
881 bool needMore
= FALSE
;
883 wxWindowList::Node
* node
= wxTopLevelWindows
.GetFirst();
886 wxWindow
* win
= node
->GetData();
887 if (SendIdleEvents(win
))
889 node
= node
->GetNext();
895 // Send idle event to window and all subwindows
896 bool wxApp::SendIdleEvents(wxWindow
* win
)
898 bool needMore
= FALSE
;
901 event
.SetEventObject(win
);
903 win
->GetEventHandler()->ProcessEvent(event
);
905 win
->OnInternalIdle();
907 if (event
.MoreRequested())
910 wxNode
* node
= win
->GetChildren().First();
913 wxWindow
* win
= (wxWindow
*) node
->Data();
914 if (SendIdleEvents(win
))
923 void wxApp::DeletePendingObjects()
925 wxNode
*node
= wxPendingDelete
.First();
928 wxObject
*obj
= (wxObject
*)node
->Data();
932 if (wxPendingDelete
.Member(obj
))
935 // Deleting one object may have deleted other pending
936 // objects, so start from beginning of list again.
937 node
= wxPendingDelete
.First();
941 // Create display, and other initialization
942 bool wxApp::OnInitGui()
944 // Eventually this line will be removed, but for
945 // now we don't want to try popping up a dialog
946 // for error messages.
947 delete wxLog::SetActiveTarget(new wxLogStderr
);
949 if (!wxAppBase::OnInitGui())
952 GetMainColormap( wxApp::GetDisplay() );
954 m_maxRequestSize
= XMaxRequestSize( (Display
*) wxApp::GetDisplay() );
959 WXColormap
wxApp::GetMainColormap(WXDisplay
* display
)
961 if (!display
) /* Must be called first with non-NULL display */
962 return m_mainColormap
;
964 int defaultScreen
= DefaultScreen((Display
*) display
);
965 Screen
* screen
= XScreenOfDisplay((Display
*) display
, defaultScreen
);
967 Colormap c
= DefaultColormapOfScreen(screen
);
970 m_mainColormap
= (WXColormap
) c
;
972 return (WXColormap
) c
;
975 Window
wxGetWindowParent(Window window
)
977 wxASSERT_MSG( window
, "invalid window" );
981 Window parent
, root
= 0;
985 unsigned int noChildren
= 0;
987 Window
* children
= NULL
;
989 // #define XQueryTree(d,w,r,p,c,nc) GrQueryTree(w,p,c,nc)
994 XQueryTree((Display
*) wxGetDisplay(), window
, & root
, & parent
,
995 & children
, & noChildren
);
1008 retValue
= wxTheApp
->OnExit();
1012 * Exit in some platform-specific way. Not recommended that the app calls this:
1013 * only for emergencies.
1018 // Yield to other processes
1020 bool wxApp::Yield(bool onlyIfNeeded
)
1022 bool s_inYield
= FALSE
;
1026 if ( !onlyIfNeeded
)
1028 wxFAIL_MSG( wxT("wxYield called recursively" ) );
1036 // Make sure we have an event loop object,
1037 // or Pending/Dispatch will fail
1038 wxEventLoop
* eventLoop
= wxEventLoop::GetActive();
1039 wxEventLoop
* newEventLoop
= NULL
;
1042 newEventLoop
= new wxEventLoop
;
1043 wxEventLoop::SetActive(newEventLoop
);
1046 while (wxTheApp
&& wxTheApp
->Pending())
1047 wxTheApp
->Dispatch();
1050 wxTimer::NotifyTimers();
1056 wxEventLoop::SetActive(NULL
);
1057 delete newEventLoop
;
1065 void wxApp::OnAssert(const wxChar
*file
, int line
, const wxChar
*msg
)
1067 // While the GUI isn't working that well, just print out the
1070 wxAppBase::OnAssert(file
, line
, msg
);
1073 msg2
.Printf("At file %s:%d: %s", file
, line
, msg
);