+ /* insert GTK representation */
+ (*m_insertCallback)(this, child);
+}
+
+#ifdef __WXGTK20__
+
+void wxWindowGTK::AddChild(wxWindowBase *child)
+{
+ wxWindowBase::AddChild(child);
+ m_dirtyTabOrder = true;
+ if (g_isIdle)
+ wxapp_install_idle_handler();
+}
+
+void wxWindowGTK::RemoveChild(wxWindowBase *child)
+{
+ wxWindowBase::RemoveChild(child);
+ m_dirtyTabOrder = true;
+ if (g_isIdle)
+ wxapp_install_idle_handler();
+}
+
+void wxWindowGTK::DoMoveInTabOrder(wxWindow *win, MoveKind move)
+{
+ wxWindowBase::DoMoveInTabOrder(win, move);
+ m_dirtyTabOrder = true;
+ if (g_isIdle)
+ wxapp_install_idle_handler();
+}
+
+void wxWindowGTK::RealizeTabOrder()
+{
+ if (m_wxwindow)
+ {
+ if (m_children.size() > 0)
+ {
+ GList *chain = NULL;
+
+ for (wxWindowList::const_iterator i = m_children.begin();
+ i != m_children.end(); ++i)
+ {
+ chain = g_list_prepend(chain, (*i)->m_widget);
+ }
+
+ chain = g_list_reverse(chain);
+
+ gtk_container_set_focus_chain(GTK_CONTAINER(m_wxwindow), chain);
+ g_list_free(chain);
+ }
+ else
+ {
+ gtk_container_unset_focus_chain(GTK_CONTAINER(m_wxwindow));
+ }
+ }
+
+ m_dirtyTabOrder = false;
+}
+
+#endif // __WXGTK20__
+
+void wxWindowGTK::Raise()
+{
+ wxCHECK_RET( (m_widget != NULL), wxT("invalid window") );
+
+ if (m_wxwindow && m_wxwindow->window)
+ {
+ gdk_window_raise( m_wxwindow->window );
+ }
+ else if (m_widget->window)
+ {
+ gdk_window_raise( m_widget->window );
+ }
+}
+
+void wxWindowGTK::Lower()
+{
+ wxCHECK_RET( (m_widget != NULL), wxT("invalid window") );
+
+ if (m_wxwindow && m_wxwindow->window)
+ {
+ gdk_window_lower( m_wxwindow->window );
+ }
+ else if (m_widget->window)
+ {
+ gdk_window_lower( m_widget->window );
+ }
+}
+
+bool wxWindowGTK::SetCursor( const wxCursor &cursor )
+{
+ wxCHECK_MSG( (m_widget != NULL), FALSE, wxT("invalid window") );
+
+ if (cursor == m_cursor)
+ return FALSE;
+
+ if (g_isIdle)
+ wxapp_install_idle_handler();
+
+ if (cursor == wxNullCursor)
+ return wxWindowBase::SetCursor( *wxSTANDARD_CURSOR );
+ else
+ return wxWindowBase::SetCursor( cursor );
+}
+
+void wxWindowGTK::WarpPointer( int x, int y )
+{
+ wxCHECK_RET( (m_widget != NULL), wxT("invalid window") );
+
+ // We provide this function ourselves as it is
+ // missing in GDK (top of this file).
+
+ GdkWindow *window = (GdkWindow*) NULL;
+ if (m_wxwindow)
+ window = GTK_PIZZA(m_wxwindow)->bin_window;
+ else
+ window = GetConnectWidget()->window;
+
+ if (window)
+ gdk_window_warp_pointer( window, x, y );
+}
+
+
+void wxWindowGTK::Refresh( bool eraseBackground, const wxRect *rect )
+{
+ if (!m_widget)
+ return;
+ if (!m_widget->window)
+ return;
+
+#ifndef __WXGTK20__
+ if (g_isIdle)
+ wxapp_install_idle_handler();
+
+ wxRect myRect;
+ if (m_wxwindow && rect)
+ {
+ myRect.SetSize(wxSize( m_wxwindow->allocation.width,
+ m_wxwindow->allocation.height));
+ if ( myRect.Intersect(*rect).IsEmpty() )
+ {
+ // nothing to do, rectangle is empty
+ return;
+ }
+
+ rect = &myRect;
+ }
+
+ // schedule the area for later updating in GtkUpdate()
+ if (eraseBackground && m_wxwindow && m_wxwindow->window)
+ {
+ if (rect)
+ {
+ m_clearRegion.Union( rect->x, rect->y, rect->width, rect->height );
+ }
+ else
+ {
+ m_clearRegion.Clear();
+ m_clearRegion.Union( 0, 0, m_wxwindow->allocation.width, m_wxwindow->allocation.height );
+ }
+ }
+
+ if (rect)
+ {
+ if (m_wxwindow)
+ {
+ m_updateRegion.Union( rect->x, rect->y, rect->width, rect->height );
+ }
+ else
+ {
+ GdkRectangle gdk_rect;
+ gdk_rect.x = rect->x;
+ gdk_rect.y = rect->y;
+ gdk_rect.width = rect->width;
+ gdk_rect.height = rect->height;
+ gtk_widget_draw( m_widget, &gdk_rect );
+ }
+ }
+ else
+ {
+ if (m_wxwindow)
+ {
+ m_updateRegion.Clear();
+ m_updateRegion.Union( 0, 0, m_wxwindow->allocation.width, m_wxwindow->allocation.height );
+ }
+ else
+ {
+ gtk_widget_draw( m_widget, (GdkRectangle*) NULL );
+ }
+ }
+#else // GTK+ 2
+ if (m_wxwindow)
+ {
+ GdkRectangle gdk_rect,
+ *p;
+ if (rect)
+ {
+ gdk_rect.x = rect->x;
+ gdk_rect.y = rect->y;
+ gdk_rect.width = rect->width;
+ gdk_rect.height = rect->height;
+ p = &gdk_rect;
+ }
+ else // invalidate everything
+ {
+ p = NULL;
+ }
+
+ gdk_window_invalidate_rect( GTK_PIZZA(m_wxwindow)->bin_window, p, TRUE );
+ }
+#endif // GTK+ 1/2