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

what's with the auto-insert of run-mode as the first arg for script-fu methods?

This discussion is connected to the gimp-user-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.

Gary Aitken
2012-09-20 05:43:35 UTC (about 12 years ago)

what's with the auto-insert of run-mode as the first arg for script-fu methods?

Using gimp 2.6
I originally defined my script-fu procedure as

(define (my-proc fileExpr) ...
)

and registered it using:

(script-fu-register "my-proc"
...
"" ; image type the script works on SF-STRING "FileNameExpression" "" )

But the procedure browser lists it as taking two args, the first of which is
run-mode INT32 Interactive, non-interactive

In order to get it to work, I had to change the definition to:

(define (my-proc runMode fileExpr) ...
)

but left the registration as is (without run-mode).

What's the deal with the auto-insert of run-mode in the procedure browser help, and do I have to define it as an arg in the registration? If so, what is its type?
(I tried SF-RUN-MODE and it didn't like that) If I leave it as is and try to use it from the menu instead of the script-fu console,
There's no place to enter the run-mode in the dialog which pops up, and it feeds the string first arg in as the run-mode and barfs.

totally confused, looking for some enlightment...

2012-09-20 08:12:18 UTC (about 12 years ago)
postings
16

what's with the auto-insert of run-mode as the first arg for script-fu methods?

There's half an explanation in this e-mail chain: http://www.gimpusers.com/forums/gimp-developer/10891-run-mode-enums

But essentially, if you start your procedure name with script-fu- then the run mode is implicit and you shouldn't include it in any definitions.

The fact that it turns up in the procedure browser is confusing, but knowing when to ignore it is just one of those things to learn.

Kevin Cozens
2012-09-24 20:38:11 UTC (about 12 years ago)

what's with the auto-insert of run-mode as the first arg for script-fu methods?

On 12-09-20 01:43 AM, Gary Aitken wrote:

But the procedure browser lists it as taking two args, the first of which is
run-mode INT32 Interactive, non-interactive

The procedure browser outputs information oriented more at C based plugins and not Scheme scripts. Scheme scripts do not take a run-time argument but you need to include the run-mode argument in the parameter list of a Scheme statement that is calling a non-Scheme based plug-in.