We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › define window position on screen
Page Index Toggle Pages: 1
define window position on screen? (Read 1402 times)
define window position on screen?
Jan 19th, 2010, 8:02am
 
how do i tell a sketch to start its window at a specific position on the screen

there's ARGS_EXTERNAL, i reckon it should be possible with this, though i'm new to Java main() and args[] thing and not so sure how to use it...

Code:
public static void main(String[] args)
{
PApplet.main(new String[] {MY_NAME, ARGS_EXTERNAL});
}


this right?

and then in the commandline
Code:

java AwesomeSketch "100 100"

how do i find out the syntax for this argument do i need to parse it into something else see also here:

EDIT:

got it. also using "--location", not external. when running the sketch, the args come after the sketch name like so
Code:
acid$ java -cp .:core.jar Child0001 --location=100,200

while PApplet.main() takes the args before the sketch name...
so main looks like this
Code:
public static void main(String[] args)
{
args = append(args, MY_NAME);
PApplet.main(args);
}

and it works  Cheesy
Page Index Toggle Pages: 1