G4P - G4P.selectInput show behind on fullScreen P2D render mode

edited April 2016 in Library Questions

Hello,

I'm trying to use G4P library to open a file width a selectInput function. If I use the default render mode JAVA2D on fullScreen it works and the input windows appears on top of processing sketch, but if I use P2D or P3D renders on fullScreen the input windows appears behind the sketch.

There is a way to set the input windows always on top of sketch?

I'm use Processing 3 and G4P 4.1

Thanks in advanced

Example code :

// Need G4P library
import g4p_controls.*;    


public void setup(){
  fullScreen(P2D);
  //size(480, 320); //works
  createGUI();
  customGUI();

  // Place your setup code here
  sketchFullScreen();
}

public void draw(){
  background(230);

}

// Use this method to add additional statements
// to customise the GUI controls
public void customGUI(){

}

public void button1_click1(GButton source, GEvent event) { //_CODE_:button1:921983:
  G4P.selectInput("Input Dialog");
} //_CODE_:button1:921983:



// Create all the GUI controls. 
// autogenerated do not edit
public void createGUI(){
  G4P.messagesEnabled(false);
  G4P.setGlobalColorScheme(GCScheme.BLUE_SCHEME);
  G4P.setCursor(ARROW);
  surface.setTitle("Sketch Window");
  button1 = new GButton(this, 188, 145, 80, 30);
  button1.setText("Open Input Dialog");
  button1.addEventHandler(this, "button1_click1");
}

// Variable declarations 
// autogenerated do not edit
GButton button1;

Answers

  • edited April 2016

    G4P uses the standard Java dialogs so I suspect the problem is related to the how the computer implemehts OpenGL in full screen mode (both P2D and P3D use OpenGL).

    OK I just noticed that you have tried it in windowed mode and it works which suggests that I am right. I think you will probably find that this problem also occurs with Processing's dialog boxes because they also use Java dialogs albeit in a separate thread. (try using one and see what happens)

  • Hello, thanks for answering.

    I tested this sketch in 2 computers (windows and linux) and i haved the same result, the windows appers behind the sketch in fullScreen(P2D or P3D) mode.

    This problem also occurs with the Processing dialog, I tested the selectInput dialog from processing and I haved the same result.

    So to solved this problem I need to change the way computer implements OpenGL?

    Thanks in advanced

    Erick

  • I don't know of a solution or even if there is a solution when using OpenGL in fullscreen mode. :(

Sign In or Register to comment.