G4P - Peter, about the Droplist file - What Kind? Where?

Again, than you for the library.

Tried to use for the first time that droplist but I get:

The file “list_396198” is missing or inaccessible, make sure the URL is valid or that the file has been added to your sketch and is readable.

I made a CSV and a TXT named “list_396198” but the program does not want them.
Looked in your examples, but not one has a drop down menu.

Also, your examples dont look anything like the files we make with the G4P tool.
They dont even have a gui tab. If I try to edit an example with the GUI tool, the tool shows a blank page.
How can I learn from them?

The library is great, but the learning is such an uphill battle.
Could you make a help menu?

Thanks again,
Mitch

1 Like

Just to clarify the situation, there is a Processing library called G4P which can be used on its own to create GUI controls Then there is a Processing tool called GUI Builder which provides a visual editor to create and position G4P controls.

If you are using GUI Builder to create a GDropList control then you must also create the list file in GUI Builder. If you look at GUI Builder on my website then watch the third video guide, That should help you.

The gui tab is used to store code created by GUI Builder everytime you make changes in te design window. Most of the example sketches were created without GUI Builder.

If you want to create a sketch with G4P controls then you have a choice

  • use GUI Builder
  • don’t use GUI Builder

you can’t mix or match. Any controls created outside GUI Builder cannot be edited with GUI Builder!

G4P is a huge library with many features, it is impossible to provide examples demonstrating all of them.

As to learning G4P

  • there is a lot of information on my website
  • create small exercise sketches that focus on a control so you understand its capabilities
  • study and experiment with the examples by modifying the code
  • use this forum
  • the source reference guide (available on-line and included with the library)

As with any large library the hardest part is getting started, as you learn more the faster your progress becomes.

2 Likes

Peter, thanks a lot, I did not know that you had videos. Wish I knew, that helps. I will watch them all.

My other question:
Is there a way to disable a button or a slider while a boolean is true or false?
I am building a situation where there is a setup mode and a “record” mode. While recording, I dont want the slider and some buttons to work.
I was thinking to draw a big rectangle over them, but a user can still click or glide by chance.

Thanks
Mitch

1 Like
button.setEnabled(true/false)
slider.setEnabled(true/false)

true/false = true, fale or boolean variable.

2 Likes

Thanks that worked,

For others I ended up with code like this:

   if (StartStop == false)
  {
   SH_ABC.setEnabled(true);
   SHIFT_LENGTH.setEnabled(true);

  }
    else if (StartStop )  // Going in recording mode
 {   SH_ABC.setEnabled(false);
   SHIFT_LENGTH.setEnabled(false);
}

Also, I was hoping to have numbers along the slider, I did it in the past, but it does not work anymore.

The code from gui tab is this:

  SHIFT_LENGTH = new GSlider(this, 250, 280, 1310, 50, 30.0);
  SHIFT_LENGTH.setShowValue(true);
  SHIFT_LENGTH.setShowLimits(true);
  SHIFT_LENGTH.setLimits(8, 1, 12);
  SHIFT_LENGTH.setNbrTicks(12);
  SHIFT_LENGTH.setStickToTicks(true);
  SHIFT_LENGTH.setShowTicks(true);
  SHIFT_LENGTH.setNumberFormat(G4P.INTEGER, 0);
  SHIFT_LENGTH.setOpaque(true);
  SHIFT_LENGTH.addEventHandler(this, "slider1_change1");

but the slider looks like this

What am I doing wrong?
Thanks

1 Like
SHIFT_LENGTH = new GSlider(this, 250, 280, 1310, 50, 30.0);

All G4P controls use an offscreen buffer for its appearance, the size of the buffer is specified in the constructor. In the above statement this buffer will be 1310 x 50 pixels in size, This is too narrow to show the ticks etc. increase the 50 until you can see everything you need.

2 Likes