View Full Version : having trouble with gtk2-perl and cairo
haricharan
February 14th, 2007, 06:44 PM
i am trying to convert a gtk script from C to perl. I converted most of it except this line
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
I found its python equivalent in pygtk to be
cr.set_operator(cairo.OPERATOR_SOURCE)
But i want it in perl. Can someone please tell how this line translates to perl. I checked the gtk2-perl documentation. Its not listed there....
haricharan
February 15th, 2007, 05:40 AM
bump....
haricharan
February 18th, 2007, 04:04 AM
no suggestions?????? :( :( :confused:
slavik
February 18th, 2007, 04:31 AM
why not simply keep it?
check on the details about embedding C code inside Perl code ...
Snargle
February 18th, 2007, 11:09 AM
I'm not familiar with operators, but there's a couple operator functions shown here:
http://cpan.uwinnipeg.ca/htdocs/Cairo/Cairo.html#cr_gt_set_operator_op
It looks like it takes arguments such as 'over', 'atop', 'in', etc.
A C function wouldn't be easy because it can't be passed $cr, which is a perl hash reference instead of a c struct pointer.
haricharan
February 19th, 2007, 06:30 AM
why not simply keep it?
check on the details about embedding C code inside Perl code ...
i cant keep it as it.....my whole application is in perl....i wanted to embed windows with alpha masks for it....and important thing i dont know much of python.....i can try in C though..and also lemme try the embedding stuff...thank you anyway... :)
haricharan
February 19th, 2007, 06:31 AM
I'm not familiar with operators, but there's a couple operator functions shown here:
http://cpan.uwinnipeg.ca/htdocs/Cairo/Cairo.html#cr_gt_set_operator_op
It looks like it takes arguments such as 'over', 'atop', 'in', etc.
A C function wouldn't be easy because it can't be passed $cr, which is a perl hash reference instead of a c struct pointer.
thanks for the link..but it doesnt give abt operator in much detail.....lemme try searching more!!
Snargle
February 19th, 2007, 11:55 AM
This works:
$cr->set_operator ('source');
I'm sure it's equivalent to "cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);"
haricharan
February 19th, 2007, 04:01 PM
This works:
$cr->set_operator ('source');
I'm sure it's equivalent to "cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);"
Thanks a lot it works....i had been trying all kinds of possibilities....but it didnt strike for me to use just 'source'...
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.