SelectInput and P2D/P3D

The following code works:

    void setup()
    {
      size(640, 480);
    }
    void draw()
    {
      rect(100,100,100,200);
    }

    void keyPressed()
    {
      if (key=='o'||key=='O')
      {
        openLoad();
      }
    }

    void openLoad()
    {
      noLoop();
      selectInput("Select a file...", "loadFile");
    }

    void loadFile(File selection)
    {
      if (selection == null)
      {
        println("No file selected.");
      }
      else
      {
        println(selection.getAbsolutePath());
      }
      loop();
    }

But with size(640, 480,P2D); OR size(640, 480,P3D) i got a problem:
pressing "o" the program minimize and show the open file Dialog;
sometimes the open file dialog is minimized too.

Can you help me ? :)

Tagged:
Sign In or Register to comment.