Bug 64 : if size() not found when exporting an applet, ask the user
Last modified: 2008-09-20 18:20




Status:
RESOLVED
Resolution:
WONTFIX -
Priority:
P5
Severity:
enhancement

 

Reporter:
fry
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2005-07-15 15:50
more prompts, more code, more problems
Additional Comment #1 From Classiclll 2006-04-16 07:26
At first export of new sketch (not "saved as"), a line on a wrong
sized window in case1, and no lines in case2.

case1:
int w=200, h=200;
void setup() {
line(10,10,90,90);
}
void draw() {
}

case2:
Foo f = new Foo(200,200);
void setup() {
size(f.w,f.h);
line(10,10,90,90);
}
void draw() {
}
class Foo {
int w,h;
Foo(int ww, int hh) {
w = ww;
h = hh;
}
}
Additional Comment #2 From fry 2006-04-17 12:28
this is why the reference for size() states "Using variables as the parameters to size() is
strongly discouraged and can create problems."