RSS/Atom feed Twitter
Site is read-only, email is disabled

Creation of script-fu dialogs?

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

2 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

Creation of script-fu dialogs? Rob Antonishen 30 Nov 16:26
  Creation of script-fu dialogs? saulgoode@flashingtwelve.brickfilms.com 30 Nov 21:53
Rob Antonishen
2009-11-30 16:26:02 UTC (almost 15 years ago)

Creation of script-fu dialogs?

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.

Thanks,

-Rob A>

saulgoode@flashingtwelve.brickfilms.com
2009-11-30 21:53:01 UTC (almost 15 years ago)

Creation of script-fu dialogs?

Quoting Rob Antonishen :

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.

You can't guarantee the order with which scripts within a particular directory are loaded, but you can guarantee that a particular separate directory will be loaded before another directory.

So if you were place your hex_grid.scm script in ~/.gimp-2.6/scripts/preload/ and add that folder to the TOP of the list of scripts folders in your Preferences (or prepend it to the 'script-fu-path' argument in gimprc), you will guarantee that it will be loaded before the other scripts. (Alternately, you could place the script that requires hex_grid into a "post-load" directory which gets specified at the bottom of the list of script folders in Preferences.)

This is probably not of much help to you, though. :)