wx and GL events

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
moetman
Earned a small fee
Earned a small fee
Posts: 18
Joined: Tue Nov 23, 2004 4:06 am

wx and GL events

Post by moetman » Thu Feb 17, 2005 5:54 am

I'm using a wxPanel holding my wxGLCanvas but I can't get it to handle events. What should you do to be able to handle key and mouse events ? Context ID's ?

Regards

mjs
Experienced Solver
Experienced Solver
Posts: 93
Joined: Wed Feb 09, 2005 3:53 am
Contact:

Post by mjs » Thu Feb 17, 2005 9:30 am

You should query the events from the wxGLCanvas directly.

Here's a part of the isosurf sample:

Code: Select all

BEGIN_EVENT_TABLE(TestGLCanvas, wxGLCanvas)
    EVT_SIZE(TestGLCanvas::OnSize)
    EVT_PAINT(TestGLCanvas::OnPaint)
    EVT_CHAR(TestGLCanvas::OnChar)
    EVT_MOUSE_EVENTS(TestGLCanvas::OnMouseEvent)
    EVT_ERASE_BACKGROUND(TestGLCanvas::OnEraseBackground)
END_EVENT_TABLE()
Regards,
Mark

moetman
Earned a small fee
Earned a small fee
Posts: 18
Joined: Tue Nov 23, 2004 4:06 am

Post by moetman » Thu Feb 17, 2005 12:08 pm

Thanks Mark,
I was missing the OnMouse from my Event table, assumed I had put it in.

Best Regards :)

Post Reply