Loading...
Logo
Processing Forum
I am trying to save desktop space for a GUI Iam building using G4P.
The Idea is to have 5 nice big buttons on a small controlpad but have each of the buttons trigger a drop down menu that has all of the button specific controls within it.
 
I am trying to see if there is a clever way to accomplish this.
 
My best possible solution is to have a GUI window and use create window tile feature to make 5 windows that sit exactly on top of each other just below the main window.  The idea is that when you select a button on the main window it will make the specific sub window non transparent.
 
I also thought maybe I could have the sub windows all non transparent but laying behind the main window as to not be visible...  when a button is pushed the sub windows position changes 4 pixels at a time in the -Y direction so it drops down into sight...  The thing I noticed is that the sub windows seem to be in the foreground not the main one.  When I take another window such as notepad and slide it in front of a GUI the main one is covered by it but the sub windows are in front...
 
 
I am building a G4P GUI as we speak using the G4P tool but I haven't decide on the best approach ...  any ideas or suggestions??

Replies(5)

The thing I noticed is that the sub windows seem to be in the foreground not the main one.  When I take another window such as notepad and slide it in front of a GUI the main one is covered by it but the sub windows are in front...

By default GWindo objects are created so they are always-on-top you change this with the GWindow method setOnTop(boolean) e.g.

window.setOnTop(false); // window being a GWindow object

I would recommend looking at multiple GPanels like this applet.

The Processing project for this applet can be downloaded here

That example will do the trick!!! thanks
 
I just got rid of my windows and replaced them with floating panels as per your example above.
This should work great except that I did not realize that panels don't have the option of adjusting the background color as do the secondary windows.
 
I already photoshoped a ton of icons and they are based on a black background.
 
Is there any way I can change the panel background to black.
If so can the panel titlebar color change as well???
Is there any way I can change the panel background to black.
If so can the panel titlebar color change as well???

Yes but it involves editing the colour schemes image to create a new colour scheme.

  1. In your sketch folder create a new folder called data (if it does not already exist).
  2. In your Processing folder you will find a folder called libraries. In this folder locate the file default_gui_palette.png file in the folder G4P | src | data then copy it to the data folder from step 1
  3. Rename the copy to user_gui_palette.png
  4. Open the image (see below) and in the last row fill all the squares with black then save it with the same filename (do not change the image type from png)
  5. In you code use panel.setLocalColorScheme(15); for each panel


I have not actually done this myself but it should work.
This solution worked great!!!
Thanks quarks!