From d51ce354c1baff262ec481fa5db0b6f4b37ad274 Mon Sep 17 00:00:00 2001 From: Lauri Nurmi Date: Wed, 18 May 2016 09:39:41 +0300 Subject: [PATCH] Document that wxFileSystemWatcher requires a running event loop On Gtk and OS X, but unfortunately not MSW, an assert fails if a wxFileSystemWatcher is created too early. Therefore give a hint about where and when one should be created. Closes https://github.com/wxWidgets/wxWidgets/pull/287 --- interface/wx/fswatcher.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/interface/wx/fswatcher.h b/interface/wx/fswatcher.h index 40078e7e46..5675a7a666 100644 --- a/interface/wx/fswatcher.h +++ b/interface/wx/fswatcher.h @@ -21,6 +21,13 @@ version doesn't currently collapse pairs of create/delete events in a rename event, unlike the other ones. + @note The application's event loop needs to be running before a + wxFileSystemWatcher can be properly created, and that is why one + should not be created too early during application startup. + If you intend to create a wxFileSystemWatcher at startup, you can + override wxAppConsole::OnEventLoopEnter() to ensure it is not done + too early. + For the full list of change types that are reported see wxFSWFlags. This class notifies the application about the file system changes by