+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();
+}
+
+bool wxWindowGTK::GTKWidgetNeedsMnemonic() const
+{
+ // none needed by default
+ return false;
+}
+
+void wxWindowGTK::GTKWidgetDoSetMnemonic(GtkWidget* WXUNUSED(w))
+{
+ // nothing to do by default since none is needed
+}
+
+void wxWindowGTK::RealizeTabOrder()
+{
+ if (m_wxwindow)
+ {
+ if ( !m_children.empty() )
+ {
+ // we don't only construct the correct focus chain but also use
+ // this opportunity to update the mnemonic widgets for the widgets
+ // that need them
+
+ GList *chain = NULL;
+ wxWindowGTK* mnemonicWindow = NULL;
+
+ for ( wxWindowList::const_iterator i = m_children.begin();
+ i != m_children.end();
+ ++i )
+ {
+ wxWindowGTK *win = *i;
+
+ if ( mnemonicWindow )
+ {
+ if ( win->AcceptsFocusFromKeyboard() )
+ {
+ // wxComboBox et al. needs to focus on on a different
+ // widget than m_widget, so if the main widget isn't
+ // focusable try the connect widget
+ GtkWidget* w = win->m_widget;
+ if ( !GTK_WIDGET_CAN_FOCUS(w) )
+ {
+ w = win->GetConnectWidget();
+ if ( !GTK_WIDGET_CAN_FOCUS(w) )
+ w = NULL;
+ }
+
+ if ( w )
+ {
+ mnemonicWindow->GTKWidgetDoSetMnemonic(w);
+ mnemonicWindow = NULL;
+ }
+ }
+ }
+ else if ( win->GTKWidgetNeedsMnemonic() )
+ {
+ mnemonicWindow = win;
+ }
+
+ chain = g_list_prepend(chain, win->m_widget);
+ }
+
+ chain = g_list_reverse(chain);
+
+ gtk_container_set_focus_chain(GTK_CONTAINER(m_wxwindow), chain);
+ g_list_free(chain);
+ }
+ else // no children
+ {
+ gtk_container_unset_focus_chain(GTK_CONTAINER(m_wxwindow));
+ }
+ }
+}
+