Hello.............
Is there any way For switching between canvases other that using(Softkeys or Commandlister)Something like Some event happens in one canvas and that will cause other canvas to be current display.
Thanzx
Chandu
Hello.............
Is there any way For switching between canvases other that using(Softkeys or Commandlister)Something like Some event happens in one canvas and that will cause other canvas to be current display.
Thanzx
Chandu
Hi,
just try catching the desired event by comparing some variable, setting some flag, etc. in your Canvas1 loop and then setting the display to YOUR_DISPLAY.setCurrent(Canvas2); which put Canvas2 on screen. Calling repaint() on Canvas2 calls its paint() method and paints contents of the canvas on the screen.
== Canvas1 ==
import javax.microedition.lcdui.*;
import com.nokia.mid.ui.*;
class Canvas1 extends FullCanvas implements Runnable {
...
private boolean goToCanvas2 = false;
private FullCanvas c2 = null;
...
Canvas1() {
// Canvas1 initialization
}
run() {
// implement your thread functionality here
(if goToCanvas2 == true) {
// stop threads here
c2 = new Canvas2(this);
display.setCurrent(c2);
}
...
}
paint() {
// paint method for Canvas1
}
}
== Canvas2 ==
import javax.microedition.lcdui.*;
import com.nokia.mid.ui.*;
class Canvas2 extends FullCanvas implements Runnable {
...
private boolean goToCanvas1 = false;
private FullCanvas c1 = null;
...
Canvas2(FullCanvas fc) {
// Canvas2 initialization
c1 = fc;
}
run() {
// implement your thread functionality here
(if goToCanvas1 == true) {
// stop threads here
display.setCurrent(c1);
}
...
}
paint() {
// paint method for Canvas2
}
}
Hope this quick sketch helps.
Kind regards,
Tinke / FN