Search code examples
c++wxwidgets

What is an event table (wxWidgets)?


What exactly is an event table and what does it do? I am asking regarding wxWidgets but maybe its a general GUI programming concept, so please correct me on that.


Solution

  • To keep it simple, the evend table tells which function to call when which event occurrs.

    However, it is an old way of mapping events to functions. It is no longer recommanded because isn't very flexible, and use macro tricks to do its job. Macros themselves are generally not very recommanded in C++.

    Unless you must stick to C++03, you should no longer use event tables. Instead, you should use the bind method for New WXWidgets projects in C++11 or later. Bind is more flexible, and don't use macro.

    You will find this recommandation in the WXWidgets tutorials, too. You must still be able to read and understand old event tables, though, because many samples haven't been updated for ages.