Inkscape.org
Creating New Extensions Hide/show UI elements based on other UI choices
  1. #1
    Chris Want Chris Want @cwant

    Hi folks, first time extension writer here!

    I would like to have a GUI that changes options shown based on the selection in another interface control.

    For example, if I have a checkbox called "Use custom color", I would like a color picker to only be shown when that option is selected (but not otherwise).

    I don't see a way to do this with INX files -- any suggestions?

    (I am guessing that since the post right above this one called "Dynamic GUI" and it suggests using gtk, that might be the way to do it, but it seems complicated ...)

    Regards,

    Chris

  2. #2
    inklinea inklinea @inklinea⛰️

    The extension system does this:

    Current svg > Extension system > svg processing > return processed svg to Inkscape gui.

    The .inx gui allows users to specify parameters send to the extension system which can be used in processing.

    Thats about it. 

    If you want a dynamic gui, then yes you have to write it yourself.

    Gtk3 / Glade / python is the easiest way. You can use Tkinter - however it's more limiting  and since Gtk3 is bundled with Inkscape - why not.

     

     

     

  3. #3
    inklinea inklinea @inklinea⛰️

    Having said that 

    https://inkscape.gitlab.io/extensions/documentation/source/inkex.gui.app.html

    Was introduced recently. 

    I haven't tried it, but I think it allows for the launching of GTK3 / Glade components from within an .inx, so may do something towards what you want. 

    However If you have never made a GTK3 interface before - you would still have to learn that first. 

  4. #4
    Chris Want Chris Want @cwant

    Thanks. I tried your inkscape-basic-gtk3 example from the other thread and got it to work. I guess what I don't like about it is that it freezes the inkscape UI while the GTK window exists (including the empty other window created by the inx). It would be nice if there were more examples to look at, but thank you for posting your proof-of-concept for GTK.

     

    Regards,

    Chris

     

Inkscape Inkscape.org Inkscape Forum Creating New Extensions Hide/show UI elements based on other UI choices