The code works, thank you. On Wed, Sep 30, 2009 at 4:31 PM, Samuel Tardieu <s...@rfc1149.net> wrote: >>>>>> "Hugo" == Hugo Schmitt <hug...@gmail.com> writes: > > Hugo> Hi again, what would be the best way to reorganize code like this > Hugo> (most Cairo functions take the same first argument): > > You may want to use "cleave" here, to get something like (untested): > > : hello-cairo ( -- ) > { 100 100 } > [ > { > [ T{ rgba f 0 0 0 1 } set-source-color ] > [ 0 0 cairo_move_to ] > [ 100 100 cairo_line_to ] > [ 100 0 cairo_move_to ] > [ 0 100 cairo_line_to ] > [ 20 cairo_set_line_width ] > [ cairo_stroke ] > > [ 0 0 50 50 cairo_rectangle ] > [ T{ rgba f 1 0 0 0.8 } set-source-color ] > [ cairo_fill ] > > [ 0 50 50 50 cairo_rectangle ] > [ T{ rgba f 0 1 0 0.6 } set-source-color ] > [ cairo_fill ] > > [ 50 0 50 50 cairo_rectangle ] > [ T{ rgba f 0 0 1 0.4 } set-source-color ] > [ cairo_fill ] > } cleave > ] make-png-image drop ; > > Sam > -- > Samuel Tardieu -- s...@rfc1149.net -- http://www.rfc1149.net/ > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register now! > http://p.sf.net/sfu/devconf > _______________________________________________ > Factor-talk mailing list > Factor-talk@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/factor-talk >
------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk