AT&T Home | AT&T Labs | Research
AT&T Labs, Inc. - Research

The Yoix® Scripting Language

Home | What's New | Grammar | Documentation | Download | License | YChart | YDAT | YWAIT | Byzgraf | FAQs
appendpath (Path tail [, int subpath]) typedict.Path
 
Appends a copy of tail to this path in a way that guarantees that the origin point, namely (0,0), of tail lands on this path's current point, and returns this path to the caller. The appended path starts a new subpath unless the optional subpath argument is supplied and has a value of 0, in which case it is treated as an extension of the current subpath. appendpath does not complain if either path is empty.
 
 Example:   The program,
import yoix.*.*;

Path p1;
Path p2;

p1 {        // "named block"
    moveto(72, 36);
    rlineto(0, -36);
    rlineto(-72, 0);
    closepath();
    moveto(72, 0);
}

p2 {        // "named block"
    moveto(0, 0);
    rlineto(72, -36);
}

JFrame f = {
    Color background = Color.white;

    paint(Rectangle r) {
        graphics {        // "named block"
            moveto(72, 72);
            appendpath(p1);
            appendpath(p2);
            appendpath(p1);
            gsave();
            setrgbcolor(0, 0, 1);
            fill();
            grestore();
            setrgbcolor(1, 0, 0);
            stroke();
        }
    }
};

f.visible = TRUE;
defines a paint function in a frame that fills and strokes a path that is built from two separate paths using appendpath.
 
 Return:   Path
 
 See Also:   Graphics, rotatepath, scalepath, shearpath, transformpath, translatepath

 

Yoix is a registered trademark of AT&T Inc.