Canceled selectInput() - function not called again

edited October 2016 in Programming Questions

I just noticed that selectInput() and selectFolder() functions can be called (and successfully open files) until they are canceled. After canceling them, the browse window does not appear when the function is called again.

Any ideas why this happens and how to overcome it?

Thanks in advance

Answers

  • Answer ✓

    Works for me, do you have an example-code that shows this behavior?

    void setup() {}
    void draw(){}
    
    void fileSelected(File selection) {
      if (selection == null) {
        println("Window was closed or the user hit cancel.");
      } else {
        println("User selected " + selection.getAbsolutePath());
      }
    }
    
    void keyPressed() {
      selectInput("Select a file to process:", "fileSelected");
    }
    
  • Oups... I forgot to reset a flag :P

Sign In or Register to comment.