In my class that's a subclass of wxPanel, my event handler never gets called, even though I can verify with Spy++ that the WM_ERASEBKGND message is being send to my window. I can also put a breakpoint in wxWindowMSW::MSWHandleMessage() [src/msw/window.cpp] and see that the windows message is coming in for my object.
My attempt to bind a handler doesn't seem problematic.
Code: Select all
bool MyClass::Create(...) {
// ...
Bind( wxEVT_ERASE_BACKGROUND, [=]( wxEraseEvent& event ) {
// emit a log message to a file
event.Skip(true);
});
return true;
}
I'm not using SetBackgroundStyle(). I can bind event handlers to other events (like wxEVT_PAINT).
What could I be doing that would affect whether or not the event handler gets invoked? Are there limitations on the quantity of handlers for wxEraseEvents? How could I verify that my handler is (properly) registered?
Any advice would be helpful. Thanks.