EventObject in menu handler different on Linux/Windows? Topic is solved

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
fbronx
Knows some wx things
Knows some wx things
Posts: 38
Joined: Tue Nov 29, 2005 8:37 am
Location: Belgium

EventObject in menu handler different on Linux/Windows?

Post by fbronx »

I've got a menu handler and it behaves differently on Windows/Linux:

Code: Select all

void FrameEventHandler::onMenu(wxCommandEvent &event)
{
  std::cout << typeid(event.GetEventObject()).name() << std::endl;
  wxObject* evtObj = dynamic_cast<wxObject *>(event.GetEventObject());
  wxString className(evtObj->GetClassInfo()->GetClassName());
  std::string name(className.mb_str());
  std::cout << name << std::endl;
}
On Linux I see a wxMenu class as eventobject and on Windows I have a wxWindow as eventobject. Is this by design or is this a bug?

I'm using wxWidgets 2.8.10
Use wxWidgets in JavaScript: GLUEscript
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria »

Platform differences are almost always bugs - unless they are documented, which I assume you have already verified. So I would perhaps recommend taking a peek at the bug tracker
"Keyboard not detected. Press F1 to continue"
-- Windows
Post Reply