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.
IndexSuggestions & BugsSoftware Bugs › size(x,y) not working
Page Index Toggle Pages: 1
size(x,y) not working? (Read 1745 times)
size(x,y) not working?
Mar 11th, 2007, 9:57pm
 
I have a very strange problem, if I set the stage size(600,300) for example, many times when I run it uses the Processing default small square and ignore this.

Anyone seen this before?

I have Processing 0124. It seems to be when I use a library, like this...

Code:

import krister.Ess.*;

void setup(){

size(600, 300);
frameRate(30);

}

void draw(){

}


Running this, 3 out of 5 times Processing will open in default size. Very annoying and strange.
Re: size(x,y) not working?
Reply #1 - Mar 12th, 2007, 12:40pm
 
http://dev.processing.org/bugs/show_bug.cgi?id=197
Re: size(x,y) not working?
Reply #2 - Apr 19th, 2007, 3:27am
 
I was having the exact same error with my applet, but I found that it could be avoided by calling the size function multiple times, like so:
Code:
 import krister.Ess.*;

void setup(){

size(600, 300);
size(600, 300);
size(600, 300);
frameRate(30);

}

void draw(){

}

My applet now loads correctly every time. Hopefully, it will work with yours, too.
Re: size(x,y) not working?
Reply #3 - Apr 19th, 2007, 4:34pm
 
I only experience this with sketches using the JAVA2D renderer -- either size(x,y) or size(x,y,JAVA2D).  Yes, on windows, btw.  If its a sketch that will run either 2d or 3d, simply changing the renderer to P3D will stop this behavior and the correct window size is produced without fail.

Another clue that "something" went wrong during setup is if you have a background() statement in setup, if you DO get the window size you requested you may still get the default gray background instead.  Again, switching to P3D fixes that as well.

For those times where the P3D renderer CAN'T be used, I insert the following as the first line of setup() and it seems to cure it (the exact ms reqd isn't known, 50 is just what works for me):

Code:

try { Thread.sleep(50); } catch (InterruptedException e) { }

Re: size(x,y) not working?
Reply #4 - Apr 20th, 2007, 2:24pm
 
sorry, should have closed this thread. please follow up in the bugs db regarding solutions or workarounds.
Page Index Toggle Pages: 1