Library:wxWidgets
| Vendor | wxWidgets team |
|---|---|
| Platforms | Platform:Windows, Linux, macOS |
| License | wxWindows Library Licence (LGPL-2 with exception) |
| Website | https://www.wxwidgets.org |
| On this wiki | Facts · Code · Notes · Topics |
Cross-platform C++ GUI toolkit (wxWindows licence); on Windows it ships as wxmsw DLLs or static code, identifies itself with a wxVERSION_STRING and routes events through static wxEventTableEntry arrays.
Identification
- Version string:
wxVERSION_STRINGis"wxWidgets X.Y.Z"(master at commit 09869a4b80 sayswxWidgets 3.3.5,wxMAJOR_VERSION 3,wxMINOR_VERSION 3,wxRELEASE_NUMBER 5ininclude/wx/version.h). It is compiled intowxGetLibraryVersionInfocode, so the textwxWidgets 3.can be found in a binary with the library inside;wxVERSION_NUMBERismajor*1000 + minor*100 + release. - DLL builds: on Windows the shared libraries are named
wxmsw<major><minor>[u][d]_<lib>_<compiler>_<vendor>.dll(for example a core library,base,adv,html,xrc); theuis the Unicode build andddebug. docs/msw/install.md (commit 09869a4b808b97f88e35c7757fa696e66189ae8a, lines 402-407) gives the examplewxmsw331u_core_vc_x64_custom.dll(MSVC, x64, default vendorcustom; the vendor string is set withVENDOR=), so the number is major, minor and release digit (331for 3.3.1) and a 64-bit MSVC build adds the architecture (_x64) before the vendor; the import libraries are namedwxmsw34ud_core.libstyle (lines 502-509). Unverified: the full set of library names; check the filename in a given binary. - Static builds: RTTI names
.?AVwxApp@@,.?AVwxFrame@@,.?AVwxWindow@@,.?AVwxEvtHandler@@,.?AVwxObject@@, plus the wxWidgets class registry (wxClassInforecords with the class name strings, created bywxIMPLEMENT_DYNAMIC_CLASS, Unverified layout). The application entry is generated bywxIMPLEMENT_APP(aWinMainthat callswxEntry), whoseOnInitvirtual of the wxApp subclass is the program's real start.
Event tables
A class using wxDECLARE_EVENT_TABLE() has a static wxEventTable record { const wxEventTable* baseTable; const wxEventTableEntry* entries; } (the base class's table, then the entries) and a static array sm_eventTableEntries[] that wxBEGIN_EVENT_TABLE(Class, Base) ... wxEND_EVENT_TABLE() defines. Each wxEventTableEntry is, in memory order: int m_id, int m_lastId (the id range; wxID_ANY = -1 in m_lastId means a single id), wxEventFunctor* m_fn, wxObject* m_callbackUserData, and a reference const int& m_eventType (stored as a pointer to the event-type variable, because the event type constants are initialised dynamically). That is 20 bytes on x86 and 32 on x64 (computed from the declaration, not measured). The array ends with the terminator wxEventTableEntry(wxEVT_NULL, 0, 0, nullptr, nullptr).
Because m_fn is a pointer to a functor object (created at static-initialisation time by wxNewEventTableFunctor) and m_eventType points to a variable, the table is mostly filled at run time: in a static binary the entries are initialised by the C++ static initialiser of the translation unit. The functor holds a pointer to the member function and the handler object (wxObjectEventFunctor); read the functor's member-function pointer to get the handler. In include/wx/event.h (commit 09869a4b808b97f88e35c7757fa696e66189ae8a, lines 264-293) wxObjectEventFunctor derives from wxEventFunctor and has two data members after the vtable pointer, wxEvtHandler *m_handler then wxEventFunction m_method. Unverified: the vtable slot order and the layout in other versions.
After lookup, wxEvtHandler::ProcessEvent walks the tables up the baseTable chain; modern code also uses dynamic Bind() handlers (wxDynamicEventTableEntry in a per-object list) which leave no static table. The event macros: EVT_BUTTON(id, fn) expands to an entry with wxEVT_BUTTON, EVT_MENU(id, fn) with wxEVT_MENU, and so on; each wxEVT_* is an int global, so the entry's event type can be matched by its (dynamically assigned) value only at run time.
Resources
wxWidgets programs on Windows use RT_DIALOG/RT_MENU resources only when built with wxUSE_RC-style resource files; most use XRC (XML UI resources, text or compressed .xrs) or code-built UI. See Format:PE (Portable Executable)/Resource directory. Unverified.
Code & repositories
- wxWidgets/wxWidgets (wxWindows Library Licence):
include/wx/event.h(wxEventTableEntryBase at line 3679, wxEventTableEntry 3728, wxEventTable 3770, wxBEGIN_EVENT_TABLE 4580) andinclude/wx/version.h. - https://github.com/wxWidgets/wxWidgets @
09869a4b808b97f88e35c7757fa696e66189ae8a· license: LGPL-2.0-or-later WITH WxWindows-exception-3.1 (declared by the contributor; GitHub's detector did not recognize a license file)
wxWidgets source (wxWindows Library Licence): include/wx/event.h defines wxEventTableEntry and the event table macros, include/wx/version.h the version string.
Tested on: source read, not run: source reading only · checked 2026-10-18; last activity 2026-10-17; Note: the latest release ships binaries; the wiki links only the source, never the binaries
Evidence & references
- Read in wxWidgets commit 09869a4b80, see the attached facts.