/*********************************************************************
 *
 * Copyright (C) 2006,  Blekinge Institute of Technology
 *
 * Filename:      Main.java
 * Author:        Simon Kagstrom <ska@bth.se>
 * Description:   Main class for Cibyl
 *
 * $Id: Main.java 11608 2006-10-12 10:20:08Z ska $
 *
 ********************************************************************/
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class Main extends MIDlet implements CommandListener
{
  private GameScreenCanvas canvas;

  public void startApp()
  {
    if (canvas == null)
      {
	canvas = new GameScreenCanvas(Display.getDisplay(this), this);
	if (!CibylConfig.disableExitCmd)
	{
	  Command exitCommand = new Command("Exit", Command.EXIT, 0);
	  canvas.addCommand(exitCommand);
	  canvas.setCommandListener(this);
	}
      }

    /* Start the canvas */
    canvas.start();
  }

  public void pauseApp()
  {
  }

  public void destroyApp(boolean unconditional)
  {
      canvas = null;
  }

  public void commandAction(Command c, Displayable s)
  {
    if (c.getCommandType() == Command.EXIT)
      {
        canvas.invokeCallback(CRunTime.CB_ATEXIT, 0, 0);
	destroyApp(true);
	notifyDestroyed();
      }
  }
}

@@ -541,71 +541,110 @@
 as;%0A
-%0A  public void startApp()%0A  %7B%0A    if (canvas == null)%0A      %7B%0A%09
+  private Display display;%0A%0A  public Main()%0A  %7B%0A    this.display = Display.getDisplay(this);%0A    this.
 canv
@@ -673,42 +673,67 @@
 vas(
-Display.getD
+this.d
 isplay
-(
+, 
 this)
-, this);%0A%09
+;%0A  %7D%0A%0A  public void startApp()%0A  %7B%0A    
 if (
@@ -764,17 +764,26 @@
 Cmd)%0A%09%7B%0A
-%09
+          
   Comman
@@ -836,19 +836,33 @@
 IT, 0);%0A
-%09
   
+          this.
 canvas.a
@@ -889,11 +889,25 @@
 d);%0A
-%09
   
+          this.
 canv
@@ -942,17 +942,8 @@
 %0A%09%7D%0A
-      %7D%0A%0A
     
@@ -965,16 +965,53 @@
 nvas */%0A
+    this.display.setCurrent(canvas);%0A
     canv
@@ -1119,22 +1119,109 @@
 %7B%0A      
-canvas
+System.out.println(%22Maboo here %22 + unconditional);%0A      canvas = null;%0A      CRunTime.memory
  = null;
@@ -1340,24 +1340,29 @@
   %7B%0A        
+this.
 canvas.invok
@@ -1399,16 +1399,21 @@
 0, 0);%0A%09
+this.
 destroyA
@@ -1423,16 +1423,21 @@
 true);%0A%09
+this.
 notifyDe

Add a constructor, slight cleanup