Inkscape.org
Creating New Extensions Unable to pass bool when using gui-hidden
  1. #1
    RuaridhW RuaridhW @RuaridhW

    In my inx file which i am trying to make completely hidden i have been using gui-hidden="true" for all parameters, but have just realised that my bool values are all coming through as None.

    Is this something i'm doing wrong or is just that bools can't be passed using gui-hidden and it's just not specifically noted with in the inkex documentation? Also assuming i'm not missing something does anyone know of a workaround?

    btw this is the code which i'm using:

    <param name="this_bool" type="bool" gui-hidden="true">true</param>

     

  2. #2
    inklinea inklinea @inklinea⛰️

    This works for me

    .inx

    <param name="text_to_text_bool" type="bool" gui-text="Some label text" gui-hidden="true">true</param>

    .py

    pars.add_argument("--text_to_text_bool", type=inkex.Boolean, dest="text_to_text_bool", default=False)

  3. #3
    RuaridhW RuaridhW @RuaridhW
    *

    inklinea thanks very much this reassured me that i wasn't going nuts. However, it turns out that placing params inside the <param type="notebook"></param> a like you would for a visible dialogue you have to define the notebook separately. I realise that defining a notebook type for a hidden gui is weird, but it is because i'm referencing a common py module which i have another gui for.

    Weirdly does not affect string or int.

    Many thanks again

Inkscape Inkscape.org Inkscape Forum Creating New Extensions Unable to pass bool when using gui-hidden