We are about to switch to a new forum software. Until then we have removed the registration on this forum.
If i have a program with more than one window, how can i show the slider in just one of those windows?
I tried to call it inside a PGraphics, but the constructor requires a PApplet. If i use this
, the slider appears on all of the windows... I tried too to call the slider only when i'm in the windown i want, but slider doesn't work if created in draw()
, only in setup()
...
Any thoughts? Thanks ;)
Answers
The easiest way to create GUIs with G4P is to use the GUI Builder tool (Tools | Add Tool menu option) but if you have already created your sketch then the code below shows how to create a second window and add a slider to it.
GUI Builder tool makes very easy! Thanks
But i think i didn't express myself very well...When i said "window", actually i meant more like a page... The program has only one window, but there are several diferent pages, or tabs...
The problem is that i call
createGUI();
insetup()
, so the slider appears in all of the pages...Sorry about the misunderstanding...
Simply show / hide the slider when required with
slider1.setVisible(true);
slider1.setVisible(false);