Canvas never gets shown (visible) on i85s, emulator works
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   michael_salmon
Posted On:   Thursday, March 14, 2002 03:10 PM

Hi, I have a class that has two canvases: one is very lightweight and I show it immediately, the other I create in a thread and block on the completion. The thread run() method after creating the canvas, does a setCurrent(canvas) and I'm able to verify that it occurs. The flag to continue is set and I block again on showNotify () which I have a second flag. showNotify() on the i85s never gets called though and my game never updates. It does work on the emulator i85s though. The code stripped down is like this. Class Manager extends TimerTask { Thread loaderT = null; Loader loader = null; BigCanvas bc = null; BaseCanvas current = null;   More>>

Hi,
I have a class that has two canvases: one is very lightweight and I show it
immediately, the other I create in a thread and block on the completion.
The thread run() method after creating the canvas, does
a setCurrent(canvas) and I'm able to verify that it occurs. The flag to
continue is set and I block again
on showNotify () which I have a second flag.
showNotify() on the i85s never gets called though and my game never updates.
It does work on the emulator i85s though.
The code stripped down is like this.

			
Class Manager extends TimerTask
{
Thread loaderT = null;
Loader loader = null;
BigCanvas bc = null;
BaseCanvas current = null;

Manager() {
loader = new Loader (this);
loaderT = new Thread(loader);
loaderT.start();
}
// this method called manager is instantiated
void start() {
timer = new Timer(); timer.schedule(this,0,delay);
setCurrentAndVisible(tmpCanvas);
}
// managers run
void run (){
if (!loader.done){
current.repaint(); return;
}
// done loading,
loaderThread = null;
advanceStates();
if (bc.visible){ // set when showNotify() called
bg.repaint();
}
void setCurrentAndVisible (MyBaseCanvas c) {
current = c; d.setCurrent(current);
}

class Loader implements Runnable{
Manager m = null; BigCanvas c = null; done = false;
Loader(Manager m){
this.m = m;
}
run () {
m.bc = new BigCanvas();
m.setCurrentAndVisible(c);
done = true;
}
}

please note that the classes and methods arent *exactly* as they are in my
code, i just copied what the process was and renamed variables to make sense
in a forum-setting. the code all compiles and runs fine in the emulator (so
if i misspelled things, or left out of part of method sigs above please dont
worry about correcting it), I'm just trying to explain my programming method
above not write exactly compiling code.

TempCanvas and Loader are both inner-classes of Manager also.

thanks a lot!    <<Less
About | Sitemap | Contact