selectInput hidden behind fullscreen processing

edited September 2014 in Programming Questions

I wrote an fullscreen Processing application in which users can import images. I am using the processing selectInput function.

On OSX everything is working perfectly, but when I use the app in Windows the dialog appears behind the fullscreen Processing app. It seems the mouse can still interact with it though. I have tried the obvious methods like toFront and alwaysOnTop on the Processing frame object but nothing seems to work.

Tagged:

Answers

  • No solutions for this one?

  • edited September 2014

    I don't have that problem on my Windows machine - maybe show some relevant lines

    PImage Img_in;       //Load image 
    PImage Img_out;
    
    String  nameImg_in = ""; 
    
    void setup() {
    
      size(displayWidth, displayHeight);
    
      //  String nameImg_in=selectInput("Load Image", "");
      selectInput("Select a file to process:", "fileSelected");
    
      //  while (nameImg_in.equals ("")) {
      //    // wait here
      //  }
    
      frameRate (1); 
    
      println ("End of setup(). ");
    }
    
    void fileSelected(File selection) {
      if (selection == null) {
        println("Window was closed or the user hit cancel.");
        exit();
      } 
      else {
        println("User selected " + selection.getAbsolutePath());
        nameImg_in =  selection.getAbsolutePath();
    
        println ("success 1");
    
        Img_in = loadImage(nameImg_in);
    
        Img_out = createImage(Img_in.width, Img_in.height, RGB);
    
        // size(Img_in.width, Img_in.height);
    
        image(Img_in, 0, 0);
    
        Img_in.loadPixels();  //pixel access
        Img_out.loadPixels();
      }
    }
    
    void draw() {
    
      if  (nameImg_in.equals ("") ||  Img_out == null  ||  Img_in == null) { 
        // wait
      }
      else {
    
        //  int loc;   
    
        // color pixelColor;
    
    
    
        for (int y = 0; y < Img_in.height; y++ ) {
          for (int x = 0; x < Img_in.width; x++ ) {
    
            // loc=x+y*width;
    
            //  pixelColor=Img_in.pixels[loc];
    
            // here is the problem i think, i wrote an incomplete draft
    
            color average = get(x, y);
    
            float red   = red(average);
            float green = green(average);
            float blue  = blue(average); 
    
            float averageFloat = ( red+green+blue ) / 3;  // much better with 0.3
    
            int averageInt = int( averageFloat ); //average color level
            set(x, y, averageInt);
          }
        }
      }
    }
    //
    
Sign In or Register to comment.