// OnPaint handlers must always create a wxPaintDC.
wxPaintDC dc(this);
+#ifndef __WXMOTIF__
if (!GetContext()) return;
+#endif
SetCurrent();
int width, height;
GetClientSize(& width, & height);
+#ifndef __WXMOTIF__
if (GetContext())
+#endif
{
SetCurrent();
glViewport(0, 0, width, height);