Gimp-Forum.net
Conditional PF_OPTION ? - 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: Conditional PF_OPTION ? (/Thread-Conditional-PF-OPTION)



Conditional PF_OPTION ? - david - 08-23-2023

Is it possible to create conditional options for PF_ commands?

For instance, I have various scripts where a selection is saved to a channel for future use. What I would like to be able to do is give the user the option, at the start, as to whether the selection is re-instated after the plug-in is run, but not appear if a selection is not present.

At the moment this is a hypothetical question, but the answer may be helpful to other people.


RE: Conditional PF_OPTION ? - Ofnuts - 08-23-2023

Not if you use the auto-generated dialogs. When the dialog appears, your code hasn't been called yet.

If there are other options, why would you worry. If this is a matter of having a dialog or not because of a single parameter, nothing prevents you from registering two entries, one with a parameter and one without.