I am trying to make a script-fu that provides different options
depending on whether other scripts are present.
I was trying to use this line in the register call:
SF-OPTION "Grid Type" (if (defined? 'script-fu-hex_grid) (list
"Square" "Hex") (list "Square"))
and it sometimes works, but not always.
from the console, using
(if (defined? 'script-fu-hex_grid) (list "Square" "Hex") (list "Square")
will always work, returning the two item list if the function exists
and the single item list of it doesn't.
I'm guessing this is a startup thing, where the pdb menus are being
built as the scripts are loaded, so if the hex script is loaded first
then it will work, but if not it won't?
Any suggestion if I am wasting my time? (I can just trap the
selection in the script, and pop a message box if they pick hex and
the script isn't installed...but that isn't as elegant.
Gimp-developer mailing list