WxEuphoria on ARM
- Posted by Jerome Nov 20, 2011
- 2944 views
Matt,
I've been using wxEuphoria on my ARM platform but I'm having trouble capturing mouse events. Since I had to cross-compile wxWidgets as well, I tried running one of the sample programs that captures mouse events and it works fine on my device. Here is the snippet of what their code looks like:
void BombsCanvas::OnMouseEvent(wxMouseEvent& event) { const int gridWidth = m_game->GetWidth(); const int gridHeight = m_game->GetHeight(); wxCoord fx, fy; event.GetPosition(&fx, &fy); ....
Now looking in wxEuphoria.cpp we have the following which seems perfectly reasonable:
object WXEUAPI mouse_event_position(intptr_t event) { s1_ptr pos = NewS1(2); wxMouseEvent * e = (wxMouseEvent*) event; pos->base[1] = e->GetX(); pos->base[2] = e->GetY(); return MAKE_SEQ( pos ); }
But anytime my wxEuphoria progam tries to get the position of a mouse event, I get a segementation fault. GDB returns the following:
0x4024edfc in wxMouseEvent::GetX() const () from /usr/lib/libwxeu.so.16 0x4024edfc <_ZNK12wxMouseEvent4GetXEv+20>: ldr r3, [r3, #36]
Any thoughts on what the difference could be? I see that wxEuphoria uses a different wxMouseEvent procedure than the example ( GetX() vs. GetPosition() ), but neither method works on my device.
Thanks in advance,
Ira