[Glade-devel] XML node order inside GtkContainers

Christian Neumair chris@gnome-de.org
Sun, 28 Mar 2004 12:00:24 +0200


Hi there!
I'm struggling with an awkward problem that bloats the glade patches I'm
writing against software:
The order of the XML nodes is based on last insertion. If you have a
huge table and do some cut'n'paste, you'll end up with having the most
recently pasted widget at the very end of the table's XML child node
list.
This could be avoided by having dedicated child sort functions inside
glade that do things on insertion like:

if (GTK_IS_TABLE (container)) {
if (child1->row < child2->row)
append_node (child2)
else if (child1->row > child2->row)
prepend_node (child2)
else {
if (child1->col <= child2->col)
append_node (child2)
else
prepend_node (child2)
}
}
else if (GTK_IS_BOX (container)) {
...
}

regs,
Chris