If your copy of the gimp includes the sphere test (test-sphere.scm) You
should read through it first.  To the user the script may be ugly but to
the programmer it provides invaluable comments and clear examples that
help you get started with Script-Fu.

I did not find that script on my machine. I googled for it and found a version dated 2004-02-03 at

SF-ADJUSTMENT _"Value" '(10 1 100 1 10 0 1)
By trial and error I found out:
1st value (10)  is the value displayed at startup.
2nd value (1)   is the lowest possible value.
3rd value (100) is the highest possible value.
4th value (1)   is the increment/decrement when the little
arrows are used
But what is the meaning of the other 3 (10, 0, 1)?
; Usage:
; SF-ADJUSTMENT "label" '(value, lower, upper, step_inc, page_inc, digits,

Thanks for that.

> page inc is a larger step value (best to go with 10 usualy) when page up
> or page down are used rather than the arrows.
> digits ... I dont think I need to explain

Experimenting with it showed it seems to be the number of digits after the decimal point.

> type allows you to show a slider in addition to the adjustement box (aka
> Spinner)

Also I look for a way to initialize such an
SF-ADJUSTMENT with the image-width or image height, i.e. set
the first value not to a fixed number but to the image
dimension (either width or height).

I'm fairly sure it is possible but difficult.  Some of scripts included
with the gimp will give you ideas on how to do this but I decided not to
spend too much time trying to figure it out.  (When you have all the rest
of your script figured out I try and point you in the right direction on
this if you are still interested.)

I looked through all the .scm files on my machine and only found explicit values ...

It is far easier to structure your script in a different way, I would use
perecentages of Image size or something else.  Describe what the script is
supposed to be doing and I might be able to make a more helpful suggestion
or even help you with your script (or recommened a similar script someone
else has written already).

>>Once I got that into operation, I'd like to "couple" the >>boxes for width and height together, in the same way the >>width/height boxes are coupled together in >>"<image>/Image/Scale Image" > Short answer: Script Fu does not offer this functionality.

I want to get values that are initialized by the image width/height and can be changed with the same behaviour as width/height in the "Scale image" dialog, i.e. by default are changed synchronous according to the image's aspect ratio - but if the user wants, he can change them independently.

One workaround for Script-Fu not offering the coupled values:
I could just use the two independent boxes for width and height, and an additional SF-OPTION with three options:
"Use width/height as given"
"Use width, calc. height from aspect ratio"
"Use height, calc. width from aspect ratio"
That doesn't show the second value, but at least gives the behaviour of it.

Read test-sphere.scm and try out a few things and then read it again but
after you have read it feel free to ask more questions.

As soon as I find it ...

It is easier for me to just point out some of the limitations of Script-Fu There is currently no way to have a Radio list in Script-Fu.

SF-OPTION is a screen-space-saving workaround ...

Script-Fu does not support UTF but it planned that Tiny-Fu (also scheme)
> will and then it will replace Script-Fu.

Ok, so far I don't need Unicode ...

I cannot stress enough how much it helps to know what it is exactly you
are trying to do and it is especially helpful if you show us the code so
that we can help.

I would show the code if I were allowed to. But company policy doesn't allow it.

Hope that helps

Yes - even if it didn't give the solution I wanted, knowing that coupling values is not possible saves me from searching for it ...

Please do take a look at my GNU Image Manipulation Program Scripts
and if you think they could be improved or have any suggestions of
new scripts that might be interesting to write please let me know.

Tomorrow (which is in fact later today, it's after midnight, time to go to bed ...)

Thanks for your help!

Gimp-user mailing list

Reply via email to