+#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_widget->window) return;
+
+ gdk_window_raise( m_widget->window );
+}
+
+void wxWindowGTK::Lower()
+{
+ wxCHECK_RET( (m_widget != NULL), wxT("invalid window") );
+
+ if (!m_widget->window) return;
+
+ 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(0,0,0,0);
+ if (m_wxwindow && rect)
+ {
+ myRect.SetSize(wxSize( m_wxwindow->allocation.width,
+ m_wxwindow->allocation.height));
+ myRect.Intersect(*rect);
+ if (!myRect.width || !myRect.height)
+ // nothing to do, rectangle is empty
+ return;
+ rect = &myRect;
+ }
+
+ if (eraseBackground && m_wxwindow && m_wxwindow->window)
+ {
+ if (rect)
+ {
+ // Schedule for later Updating in ::Update() or ::OnInternalIdle().
+ m_clearRegion.Union( rect->x, rect->y, rect->width, rect->height );
+ }
+ else
+ {
+ // Schedule for later Updating in ::Update() or ::OnInternalIdle().
+ m_clearRegion.Clear();
+ m_clearRegion.Union( 0, 0, m_wxwindow->allocation.width, m_wxwindow->allocation.height );
+ }
+ }
+
+ if (rect)
+ {
+ if (m_wxwindow)
+ {
+ // Schedule for later Updating in ::Update() or ::OnInternalIdle().
+ 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)
+ {
+ // Schedule for later Updating in ::Update() or ::OnInternalIdle().
+ 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
+ if (m_wxwindow)
+ {
+ if (rect)
+ {
+ GdkRectangle gdk_rect;
+ gdk_rect.x = rect->x;
+ gdk_rect.y = rect->y;
+ gdk_rect.width = rect->width;
+ gdk_rect.height = rect->height;
+ gdk_window_invalidate_rect( GTK_PIZZA(m_wxwindow)->bin_window, &gdk_rect, TRUE );
+ }
+ else
+ {
+ gdk_window_invalidate_rect( GTK_PIZZA(m_wxwindow)->bin_window, NULL, TRUE );
+ }
+ }
+#endif
+}
+
+void wxWindowGTK::Update()