I'm looking for a way to read the current value of selected object x and put it in param, therefore, before applying the extension, the user can see the current value and make changes accordingly. Of course, the ideal situation is to load this value automatically when the object is selected (like xml editor), but if I can do this with an additional button, it will be enough.
In any case, does the API allow me to do such things?
Hi
I have a param which I need to use it for playing with x offset of selected object:
I'm looking for a way to read the current value of selected object x and put it in param, therefore, before applying the extension, the user can see the current value and make changes accordingly.
Of course, the ideal situation is to load this value automatically when the object is selected (like xml editor), but if I can do this with an additional button, it will be enough.
In any case, does the API allow me to do such things?
The
.inx
gui system is not dynamic. It is not possible to change widget values using python.You can make a dynamic gui, but at the moment would have to be GTK3 which is bundled with Inkscape (or TKinter - I would avoid TKinter)
Using a custom gui, you lose the live preview feature.
Oh, what a painful future I imagine for the development of my extension!
Thanks for your tips
Here's a really basic example of a template you can use with GTk3, it was built using glade, which is available for windows and linux.
https://gitlab.com/inklinea/inkscape-basic-gtk3
Thank you for your kindness
It seems that it is not as difficult as I thought