I have just started learning wxWidgets, version 3.0, with C++. I have noted, that event handling in wxWidgets is done by Event tables. But one tutorial also mentioned Connect() - actually it just said : " this tutorial will be using event tables, not Connect() " .
I would like to know, what is the philosophy behind Event tables and behind Connect() ? What is the difference, when is one more suitable than the other... Thank you.
First, don't use Connect()
which was superseded by Bind() which is better in every way.
Second, both static (using event tables) and dynamic (using Bind()
) methods of handling events work and you can use whichever you prefer. Personally, I recommend using Bind()
because
The main advantages of the event tables are that
Bind()
.However they are clumsier to use because they require subclassing (deriving a new class from) an object in order to handle non-command events in it and they don't detect all errors at compile-time allowing you to write code that compiles fine but crashes at run-time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With