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
getLocationOnScreen (Object comp) yoix.swing
 
Returns a Point that represents the screen location of comp, which should be an AWT or Swing component, in the default Yoix coordinate system, which has its origin in the upper left corner of the screen, positive x to the right, positive y down, and a resolution of 72 dots per inch. getLocationOnScreen returns NULL when comp is not showing on the screen.
 
 Example:   The program,
import yoix.*.*;

JFrame f = {
    Dimension size = {
        double height = 300;
        double width = 300;
    };

    Point location = {
        double x = 200;
        double y = 100;
    };
};

printf("Screen location of f: %O\n", getLocationOnScreen(f));
f.visible = TRUE;
printf("Screen location of f: %O\n", getLocationOnScreen(f));
sleep(5);
printf("Screen location of f: %O\n", getLocationOnScreen(f));
sleep(2);
f.visible = FALSE;
creates a small frame and then shows what happens when getLocationOnScreen is called before the frame is showing, after it is made visible, and again after sleeping for 5 seconds, which should give you a chance to move it.
 
 Return:   Point
 
 See Also:   getLocationInRoot

 

Yoix is a registered trademark of AT&T Inc.