[Gimp-developer] Re: Gimp Arrays in Perl

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

 



On Tue, 3 Jun 2003, Kenny Law wrote:

> First of all, just wanna thank you guys especially Chris, Branko, Marc and
> Dov for answering some of my questions the past 2 days. Your help is greatly
> appreciated.
>
> Anyway, my question regards the gimp_pencil tool. One of its parameters
> is an array of floats. I tried to pass in this by doing
>
> //just imagine all variables contain integers
> #1.
>
> 	@positions = (0, $startPos, $width, $startPos);
> 	gimp_pencil($layer, 4, @positions );
>

That should be:

gimp_pencil($layer, 4, \@positions);

>
>
> #2.
>
> 	gimp_pencil($layer, 4,  (0, $startPos, $width, $startPos) );
>

That should be:

gimp_pencil($layer, 4, [0, $startPos, $width, $startPos]);

You need to pass a reference to an array. In both cases you passed the
array itself as multiple arguments to the functions. For more information
consult "perldoc perlref".

Regards,

	Shlomi Fish

----------------------------------------------------------------------
Shlomi Fish        shlomif@xxxxxxxxxxxxxxxxxxx
Home Page:         http://t2.technion.ac.il/~shlomif/

An apple a day will keep a doctor away. Two apples a day will keep two
doctors away.

	Falk Fish

[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