script-fu-selection-round only with restart?

2000-06-15 Thread Thomas Stolt

Hi List!

I have decided, that I want to stay with the script-fu-selection-round, instead of the 
perl-fu.  This is simply because this function does it ... nearly :)

Could somebody please verify the following short script (maybe a Linux user, since I 
am on Solaris, and I have discovered differences here):
---
(define (script-fu-text-testscript inText inFont inFontSize inTextColor)
 (let*
  (
(theImage (car (gimp-image-new 200 60 RGB)))
(theText)
(theLayer (car (gimp-layer-new theImage 200 60 RGB_IMAGE "layer" 100 NORMAL)))
  )
 (gimp-image-add-layer theImage theLayer 0)
 (gimp-drawable-fill theLayer WHITE-IMAGE-FILL)
 (gimp-selection-all theImage)
 (script-fu-selection-round 0 theImage theLayer "1.0")
 (gimp-image-clean-all theImage)
 (gimp-display-new theImage)
 )
)
(script-fu-register
 "script-fu-text-testscript";func name
 "Toolbox/Xtns/Script-Fu/Text/Test Script";menu pos
 "Creates..."
 "Michael Terry";author
 "copyright 1997, Michael Terry";copyright notice
 "October 27, 1997" ;date created
 "" ;Image type
 SF-VALUE "Text:" "\"Text Box\"";a text variable
 SF-VALUE "Font:" "\"Charter\"" ;a text variable
 SF-VALUE "Font size:" "45" ;a text variable
 SF-COLOR "Color:" '(0 0 0) ;color variable
)


The strange thing here is, that I can call this script once (it just gives me a white 
image with a rounded selection), but when I call this script again, I get the error 
message:

Script-Fu Error
ERROR: Procedural database execution failed:
(gimp_selection_bounds 0)

Only when I restart gimp, I can use it again!

Any ideas?  ... highly welcome ...

 Thomas

___
1.000.000 DM gewinnen - kostenlos tippen - http://millionenklick.web.de
[EMAIL PROTECTED], 8MB Speicher, Verschluesselung - http://freemail.web.de




Re: script-fu-selection-round only with restart?

2000-06-15 Thread Alan Buxey

hi,


 The strange thing here is, that I can call this script once (it just gives me a 
white image with a rounded selection), but when I call this script again, I get the 
error message:
 
 Script-Fu Error
 ERROR: Procedural database execution failed:
 (gimp_selection_bounds 0)
 
 Only when I restart gimp, I can use it again!

this is because you have hardcoded the image/layer as '0'.

if you keep running GIMP, then the next image you process will not be 0,
but 1,2,3 etc etc

I have had to use hardcoded numbers in my script until I can find out why
my variables arent passed through...this means I have to quit after using
my script (which is okay because its a cron batch job anyway!) but
I'd prefer to have it working.

alan




Re: script-fu-selection-round only with restart?

2000-06-15 Thread Thomas Stolt

Alan,

thanks very much!

However, I need a little "fill in" on this:

First, I think you are right, when I let the first picture open, the 
fu-selection-round works still on the first picture.  Only when I close the first one, 
I will get the error.  But how do I get around it?  And which "0" are you referring to?


thanks in advance

Thomas


___
1.000.000 DM gewinnen - kostenlos tippen - http://millionenklick.web.de
[EMAIL PROTECTED], 8MB Speicher, Verschluesselung - http://freemail.web.de