This is regarding using the functions in style.h to change the fill color
of the object currently selected on canvas. I used the following code:
SPDocument *document = sp_desktop_document(desktop);
Inkscape::Selection *selection = sp_desktop_selection(desktop);
GSList const *items = selection->itemList();
for (GSList const *i = items; i != NULL; i = i->next)
SPObject *obj=reinterpret_cast<SPObject *>(i->data);
SPStyle *style = sp_style_new_from_object(obj);
Nothing seemed to work.
I found snippets like these in the code:
getRepr()->setAttribute(key, NULL, false);
On following these lines, I tried setting a red color to all selected
Again nothing works. Could you please gimme a reference to how to use these
functions in the right way ? What should be the way if I need to change a
specific property of the style of the object ?
An example would really be very helpful.
Third Year, Computer Engineering
Delhi Technological University
Get latest updates about Open Source Projects, Conferences and News.