Inkscape.org
Creating New Extensions Load selected object attribute into extension <param>
  1. #1
    hex mex hex mex @littledemon

    Hi

    I have a param which I need to use it for playing with x offset of selected object:

    <param name="xvalue" type="float" min="-1024" max="1024" _gui-text="X Value">0</param>

    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?

     

  2. #2
    inklinea inklinea @inklinea⛰️
    😓

    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.

  3. #3
    hex mex hex mex @littledemon

    Oh, what a painful future I imagine for the development of my extension!
    Thanks for your tips

  4. #4
    inklinea inklinea @inklinea⛰️

    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

     

  5. #5
    hex mex hex mex @littledemon

    Thank you for your kindness
    It seems that it is not as difficult as I thought

Inkscape Inkscape.org Inkscape Forum Creating New Extensions Load selected object attribute into extension <param>