+//-----------------------------------------------------------------------------
+// "realize" from m_wxwindow
+//-----------------------------------------------------------------------------
+
+static gint
+gtk_glwindow_realized_callback( GtkWidget * WXUNUSED(widget), wxGLCanvas *win )
+{
+ win->m_glContext = new wxGLContext( TRUE, win, wxNullPalette, win->m_sharedContext );
+
+ XFree( g_vi );
+ g_vi = (XVisualInfo*) NULL;
+
+ return FALSE;
+}
+
+//-----------------------------------------------------------------------------
+// "expose_event" of m_wxwindow
+//-----------------------------------------------------------------------------
+
+static void
+gtk_glwindow_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExpose *gdk_event, wxGLCanvas *win )
+{
+ if (g_isIdle)
+ wxapp_install_idle_handler();
+
+ win->m_exposed = TRUE;
+
+ win->GetUpdateRegion().Union( gdk_event->area.x,
+ gdk_event->area.y,
+ gdk_event->area.width,
+ gdk_event->area.height );
+}
+
+//-----------------------------------------------------------------------------
+// "draw" of m_wxwindow
+//-----------------------------------------------------------------------------
+
+static void
+gtk_glwindow_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle *rect, wxGLCanvas *win )
+{
+ if (g_isIdle)
+ wxapp_install_idle_handler();
+
+ win->m_exposed = TRUE;
+
+ win->GetUpdateRegion().Union( rect->x, rect->y,
+ rect->width, rect->height );
+}
+
+//-----------------------------------------------------------------------------
+// "size_allocate" of m_wxwindow
+//-----------------------------------------------------------------------------
+
+static void
+gtk_glcanvas_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxGLCanvas *win )
+{
+ if (g_isIdle)
+ wxapp_install_idle_handler();
+
+ if (!win->m_hasVMT)
+ return;
+
+ wxSizeEvent event( wxSize(win->m_width,win->m_height), win->GetId() );
+ event.SetEventObject( win );
+ win->GetEventHandler()->ProcessEvent( event );
+}
+