Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Library:wxWidgets

From ReverseEngineering.wiki
Library
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_STRING is "wxWidgets X.Y.Z" (master at commit 09869a4b80 says wxWidgets 3.3.5, wxMAJOR_VERSION 3, wxMINOR_VERSION 3, wxRELEASE_NUMBER 5 in include/wx/version.h). It is compiled into wxGetLibraryVersionInfo code, so the text wxWidgets 3. can be found in a binary with the library inside; wxVERSION_NUMBER is major*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); the u is the Unicode build and d debug. docs/msw/install.md (commit 09869a4b808b97f88e35c7757fa696e66189ae8a, lines 402-407) gives the example wxmsw331u_core_vc_x64_custom.dll (MSVC, x64, default vendor custom; the vendor string is set with VENDOR=), so the number is major, minor and release digit (331 for 3.3.1) and a 64-bit MSVC build adds the architecture (_x64) before the vendor; the import libraries are named wxmsw34ud_core.lib style (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 (wxClassInfo records with the class name strings, created by wxIMPLEMENT_DYNAMIC_CLASS, Unverified layout). The application entry is generated by wxIMPLEMENT_APP (a WinMain that calls wxEntry), whose OnInit virtual 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) and include/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.