LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   gimp script-fu or python-fu user interaction (https://www.linuxquestions.org/questions/linux-software-2/gimp-script-fu-or-python-fu-user-interaction-808182/)

boblikeslinux 05-16-2010 02:27 PM

gimp script-fu or python-fu user interaction
 
Is it possible to get user interaction in these scripts? They are for batch processing is my belief so perhaps not, but I would like to make a function whereby I can click it, a selection box of an exact size appears, I then place the selection box and press something, a new file is born. Is this possible? Thank you!

colucix 05-16-2010 03:13 PM

I'm not sure about what you're trying to accomplish, but in script-fu you can create a dialog box to accept user input. Items in the dialog box can be specified and customized in the script-fu-register section at the end of the script. Here is a good example with an explanation of the available keywords. Each of these selections will be an argument to the main function. For example:
Code:

(define (script-fu-parrot inString)
; pop-up a message with the string typed by the user
(gimp-message inString)
)

(script-fu-register
"script-fu-parrot"
"<Toolbox>/Filters/Parrot"
"This procedure echoes a user defined string and exit"
"colucix"
"none"
"May 16, 2010"
""
SF-STRING "Type something" ""
)

Here the value entered as SF-STRING in the dialog box is passed to the function as the first (and only) argument "inString". Is this what you mean?


All times are GMT -5. The time now is 12:35 AM.