+#if 1
+    // Build up array with IDs and original positions
+    wxGtkTreeModelChildWithPos* temp = new wxGtkTreeModelChildWithPos[child_count];
+    size_t i;
+    for (i = 0; i < child_count; i++)
+    {
+       temp[i].pos = i;
+       temp[i].id = m_children[i];
+    }
+    // Sort array keeping original positions
+    wxQsort( temp, child_count, sizeof(wxGtkTreeModelChildWithPos),
+             &wxGtkTreeModelChildWithPosCmp, m_internal );
+    // Transfer positions to new_order array
+    gint *new_order = new gint[child_count];
+    for (i = 0; i < child_count; i++)
+       new_order[i] = temp[i].pos;
+    // Transfer IDs to m_children
+    m_children.Clear();
+    for (i = 0; i < child_count; i++)
+       m_children.Add( temp[i].id );
+    // Delete array
+    delete [] temp;
+#else