Just deletion from treeview

Moving on from adding a selector to the style dialog, my next step is to delete a selector from the selector as well as from the XML representation of the document. Following the approach to get the selection from the treeview, get_selection() is used to obtain the selected row which is then iterated using get_selected().

If the iterator exists, the corresponding row is deleted from the treeview using erase(). Deletion from XML representation is challenging. I tokenized the selector value altogether and compared the first token which is the name of the selector to the selector selected in treeview. If these two are equal, then the corresponding style node is deleted from XML representation.

However, I ended up in a crash of Inkscape while deleting the style node, so currently all it deletes is the row from treeview.

Leave a Reply