FAQ
Cover
\
Build
\
Source
\
Bugs
\
Reference
\
Libraries
\
Tools
The bugs database has moved
here
.
Bug 664 : setResizable does not redraw the screen correctly on window resize
Last modified: 2007-11-01 05:42
P
roject:
processing
trash
Version:
unspecified
Co
m
ponent:
android
book
core
libraries
pde
reference
tools
web
Status:
RESOLVED
Resolution:
FIXED -
Pr
i
ority:
P2
Severity:
normal
Platform
All
O
S:
All
Windows
Mac OS
Linux
Other
Reporter:
ds
Assigned To:
fry
Attachment
Type
Created
Size
Actions
Description
: Opened: 2007-10-27 16:37
REV 0133 Macbook Pro
From:
http://processing.org/discourse/yabb_beta/YaBB.cgi
?
board=Syntax;action=display;num=1193490050
In the example below, change the window size by dragging the bottom right corner. On OSX
the screen goes grey and will only redraw once you click. Acording to 'antiplastik' this does
redraw correctly on XP / 0125.
void setup(){
size (320, 240);
frame.setResizable(true);
noLoop();
}
void draw(){
background(255);
rect(10, 10, 100, 100);
}
public void mousePressed() {
redraw();
}
Adding a listener also causes incorrect redraw to grey most of the time.
frame.addComponentListener(new ComponentAdapter() {
public void componentResized(ComponentEvent e) {
if(e.getSource()==frame) {
redraw();
}
}
});
Additional Comment
#1 From ds 2007-10-28 16:16
I forgot to mention this behaviour happens only when noLoop() is called.
Additional Comment
#2 From fry 2007-11-01 04:42
if you tell the sketch not to update (via noLoop), you shouldn't be
surprised when it doesn't update. ;-)
more seriously, i've changed things to fire a redraw() event when the
sketch is resized so that we can avoid the situation. better to ignore the
noLoop() temporarily than to get things into this weird state.
fixed for 0134.