From 9b5a72bd1e9f3acbef90aa3bb68facd0f6ef7bb2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 4 Oct 2021 00:27:53 +0200 Subject: [PATCH] Document Connect() limitations compared to Bind() Instead of just saying that Bind() is better, provide some points illustrating why is it better. Notable mention that Connect() can only be used with methods of the classes publicly inheriting from wxEvtHandler, unlike Bind(). Closes #19266. --- interface/wx/event.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/interface/wx/event.h b/interface/wx/event.h index d9bfe9b417..9dde8ccf63 100644 --- a/interface/wx/event.h +++ b/interface/wx/event.h @@ -710,7 +710,13 @@ public: Notice that Bind() provides a more flexible and safer way to do the same thing as Connect(), please use it in any new code -- while Connect() is not formally deprecated due to its existing widespread - usage, it has no advantages compared to Bind(). + usage, it has no advantages compared to Bind() and has a number of + drawbacks, including: + + - Less compile-time safety. + - Unintuitive parameter order. + - Limited to use with the methods of the classes publicly inheriting + from wxEvtHandler. This is an alternative to the use of static event tables. It is more flexible as it allows connecting events generated by some object to an