Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Having trouble adding user interface options.
#1
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
Reply
#2
(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.
Reply
#3
(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
Reply
#4
can you please send a screenshot of ur ui. I want to make changes to my gimp too. I'd like to learn from u Smile
Reply
#5
(09-27-2022, 10:43 PM)richiie Wrote: can you please send a screenshot of ur ui. I want to make changes to my gimp too. I'd like to learn from u Smile


my stupid mistake that originated this thread aside, learning how to to interact with gimp has been a real challenge. but one piece at a time I've got the hang of it. Or at least the hang of parts of it.
Code:
register(
   "test2-Combinator",
   "Combines Layers, tracks traits",
   "Combines Layers, tracks traits",
   "@CatskillNFT",
   "@CatskillNFT",
   "9/2022",
   "test2-Combinator",
   "RGB*, GRAY*",
   [
       (PF_IMAGE, "image", "takes current image", None),
       (PF_DIRNAME,'directory','Output Directory:','.'),
       (PF_SPINNER,"collectionSize","How many images to generate? (enter -1 for ALL):",-1,(-1,10000000,1)),
       (PF_OPTION, "newExist", "Select Y to create a new collection. Select N to add to existing Collection", 1,
            (
                ["N", "Y"]
             )

        ),
       (PF_SLIDER, "rareChance", "Rare Chance: Chance to generate rare layer in image", 0, (0, 100, 1)),
       (PF_SLIDER, "superRare", "Super Rare: Chance to use another rare layer if a rare layer is used", 0, (0, 100, 1)),

     
 
   ],
   [],
   test2_Combinator,
   menu="<Image>/Python-Fu/")

main()


Attached Files Thumbnail(s)
   
Reply


Forum Jump: