Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Interrupting a long-running script
#7
(01-15-2018, 10:02 PM)Ofnuts Wrote: Most Python scripts just declare parameters and Gimp builds a parameter dialog on the fly when they are called. Those that don't either don't take parameters other than image+layer, or have a whole GUI written in Python. For a standard Python script that uses this autogenerated dialog, see Filters>Render>Cloud>Fog... (in your installation as (lib/gimp/2.0/plug-ins/foggify.py).

That's what I'm doing, I just never heard it described as "auto-generated". Here's my registration function:

Code:
register(
   "python-fu-folders",
   "Generate an image from directory hierarchy",
   "Generate an image from directory hierarchy",
   "David Kettle", "David Kettle", "2018",
   "Generate from folders ...",
   "", # type of image it works on (*, RGB, RGB*, RGBA etc...)
   [
       (PF_SPINNER, "width", "Width of image in pixels", 600, (1, 262144, 100)),
       (PF_SPINNER, "height", "Height of image in pixels", 480, (1, 262144, 100)),
       (PF_STRING, "dir", "Directory", "/Dropbox/WordPress/Galleries/Guatemala, 2009"),
       (PF_SPINNER, "opacity", "Opacity (0 - 100)", 50, (0, 100, 5)),
       (PF_COLOR, "background", "Background color", (255,255,255))
   ],
   [],
   folders, menu="<Image>/Python-Fu")
At the bottom right corner of the dialog box, there's an "OK" button and a "Cancel" button, but once the script starts running (in other words, when I click on "OK"), they're both grayed-out, I can't cancel the script once it's started running. I'm looking for some way to cancel it after it's started.
Reply


Messages In This Thread
Interrupting a long-running script - by dfkettle - 01-15-2018, 06:42 PM
RE: Interrupting a long-running script - by dfkettle - 01-15-2018, 10:14 PM

Forum Jump: