Re: [Gimp-developer] Script-Fu error ... GUI shows different image selection than what script gets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Roland Roberts (roland@xxxxxxxxxxxxx) wrote:
> I have a script-fu set up which has the following initialization:
[... The default value of SF_IMAGE gets returned even if there is just
     one image open ...]
> The problem is that my image is *not* image 0.  It is image 5.  I
> realize I have 0 as a default and most of the time that will probably
> make sense.  But why is it showing me image 5 in the option list and
> then not using it.  If I click on the option list and "select" the
> only image showing, it works correctly.

I can reproduce this behaviour and I think it is a bug.
If the user sees the entry to be correct he is likely to not click
on the image-option menu. However, the GUI will happily pass the default
value to the script.

To work around this: You could use an invalid image ID (for example -1)
as the default value. So you can easily check if this is a real image ID
or the default value. You could for example query (gimp-images-list) for
the ID of the image. But I think this behaviour should be fixed.

Another suggestion: You use SF_VALUE for the size of your images. It
most probably would be better to use 
   SF-OPTION "Size List" '("1600" "1280" "1024" ...))

you then get an integer 0,1,2 indicating the selected option. This could
be translated to the intended value by (nth index '(1600 1280 1024 ...)).

I will file a bugreport for the other issue.

Bye,
        Simon
-- 
      Simon.Budig@xxxxxxxxxxx       http://www.home.unix-ag.org/simon/


[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux