Gimp-Forum.net
Having trouble adding user interface options. - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP)
+---- Forum: Scripting questions (https://www.gimp-forum.net/Forum-Scripting-questions)
+---- Thread: Having trouble adding user interface options. (/Thread-Having-trouble-adding-user-interface-options)



Having trouble adding user interface options. - Albedo - 09-18-2022

Hi

I am having an issue adding UI stuff to my script.    I am unable to use two UI of the same type.   I think I'm missing something in my formatting.  For example:

   (PF_OPTION, "useRare", "Select N to Ignore Rare Percents. ", 0,
             (
                 ["N", "Y"]
              )

         )


That works fine.   I am able to get the Y/N info passed into my useRare parameter.  I am able to to pass it to scripts, no issue.  The problem is I want to add another PF_OPTION.  So I added

   (PF_OPTION, "useColor", "Select Y to use color ", 0,
             (
                 ["N", "Y"]
              )

         )


And that breaks my script.   I can add a PF_RADIO, or a PF_TOGGLE and they work fine too, but I cant add a duplicate for either of those.  Can anyone explain to me how I can enter into duplicate PF types to the UI?
Thank you


RE: Having trouble adding user interface options. - programmer_ceds - 09-18-2022

(09-18-2022, 03:37 PM)Albedo Wrote: Hi

I am having an issue adding UI stuff to my script.    I am unable to use two UI of the same type.   I think I'm missing something in my formatting.  For example:

   (PF_OPTION, "useRare", "Select N to Ignore Rare Percents. ", 0,
             (
                 ["N", "Y"]
              )

         )


That works fine.   I am able to get the Y/N info passed into my useRare parameter.  I am able to to pass it to scripts, no issue.  The problem is I want to add another PF_OPTION.  So I added

   (PF_OPTION, "useColor", "Select Y to use color ", 0,
             (
                 ["N", "Y"]
              )

         )


And that breaks my script.   I can add a PF_RADIO, or a PF_TOGGLE and they work fine too, but I cant add a duplicate for either of those.  Can anyone explain to me how I can enter into duplicate PF types to the UI?
Thank you

There is no intrinsic problem with having multiple occurrences of PF- types - I have a script with 2 PF-OPTIONs, 6 PF-BOOLs and 6 PF-SPINNERs.

You do need a comma (not shown in your code above) after the definition of each parameter.

I don't think you need the inner brackets either.


RE: Having trouble adding user interface options. - Albedo - 09-18-2022

(09-18-2022, 03:52 PM)programmer_ceds Wrote: There is no intrinsic problem with having multiple occurrences of PF- types - I have a script with 2 PF-OPTIONs, 6 PF-BOOLs and 6 PF-SPINNERs.

You do need a comma (not shown in your code above) after the definition of each parameter.

I don't think you need the inner brackets either.

Ty.  It was a missing comma.   .. I guess that means its tim'e to take a break today.  Thanks for lookin at it for me.  ( I cant belive myself sometimes)  Smile