# The function enableCollapse() does not exist

**URL:** https://discourse.processing.org/t/the-function-enablecollapse-does-not-exist/17718
**Category:** Libraries
**Created:** [February 11, 2020, 6:23am UTC](https://discourse.processing.org/t/the-function-enablecollapse-does-not-exist/17718 "2020-02-11T06:23:33Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![yjoeyj](https://avatars.discourse-cdn.com/v4/letter/y/839c29/32.png) [@yjoeyj](https://discourse.processing.org/u/yjoeyj)
#### Post date: [February 11, 2020, 6:23am UTC](https://discourse.processing.org/t/the-function-enablecollapse-does-not-exist/17718/1 "2020-02-11T06:23:33Z")

</div>

Hello All,

First time user of Processing and stuck on a script I obtained from github [Link](https://github.com/JLSolerLlorens/Geophonino-GUI/blob/master/GuiGeophonino.pde). I cut down the script to shorten it for here, so hope I didn’t cut off too much:

```auto
import controlP5.*;
import processing.serial.*;

/*Initialization of variables*/
Serial myPort;
String val; //store data received in the serial port
boolean firstContact = false; //is false while Processing isn't connected to Arduino
ControlP5 cp5; //cp5 printer for GUI
DropdownList ddlCom,ddlGain,ddlSr; //DDL Drop Down List objtects

PFont fontTit = createFont("arial",20);
PFont fontTex = createFont("arial",12);
PFont fontTexMini = createFont("arial",10);

Textfield status; //Text field for notifications to the user

int myColorBackground = 255; //Default Background

int state=1; //1-Conf. connection 2-Conf. acquisition 3-Ready for data acquisition 4-Acquiring data 5-Reciving file 7-File Recived

OutputStream OutputFileRecived; //Writer for file received over serial port
  
byte [] FileBuffer=new byte[0];

String folder=null; //Folder when the file downloaded from Arduino will be saved

String overwriteFile="N"; //When selected name already exist, user can overwrite it. By default, N=false.

/* Variables progress bar */
int count=0;
int ini=0;
Integer duration=0;
Integer tamFile=0;
/* End variables progress bar */

void setup() {
  size(800,500); //Window size
  
   
  cp5 = new ControlP5(this);
   // Print Status bar
  cp5.addTextlabel("textWarnings").setText("Current status: ")
  .setPosition(50,470).setColorValue(0).setFont(fontTex);

   status = ((Textfield)cp5.getController("Status"));
   status.setValue("Welcome Geophonino configuration");
  
  ddlCom = cp5.addDropdownList("serial").setPosition(270, 75);
  for (int i = 0; i < Serial.list().length; i = i+1) {
    ddlCom.addItem(Serial.list()[i], i+1); 
  }
  if (Serial.list().length==0)
  {
     status.setValue("Error, COM Port not detected, connect Geophonino and press CONNECT... button.");
  }
  customizeDl(ddlCom);
}

void customizeDl(DropdownList ddl) {
  // Format DropDownList
  ddl.enableCollapse();
  ddl.setBackgroundColor(color(190));
  ddl.actAsPulldownMenu(true);
  ddl.setItemHeight(20);
  ddl.setBarHeight(15);
  ddl.captionLabel().style().marginTop = 3;
  ddl.captionLabel().style().marginLeft = 3;
  ddl.valueLabel().style().marginTop = 10;
  ddl.setColorBackground(color(200, 200, 200));
  ddl.setColorActive(color(0, 128));
  ddl.setColorLabel(color(0,0,0));
}

```

The script should work as it has been tested by others but gives a general error ‘The function enableCollapse() does not exist’. Any ideas what I’m doing wrong?

---

<div class="post-metadata">

### Author: ![black](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/black/32/477_2.png) [@black](https://discourse.processing.org/u/black)
#### Post date: [February 11, 2020, 3:25pm UTC](https://discourse.processing.org/t/the-function-enablecollapse-does-not-exist/17718/2 "2020-02-11T15:25:36Z")

</div>

> **[sojamo/controlp5](https://github.com/sojamo/controlp5)**
>
> A gui library for processing.org. Contribute to sojamo/controlp5 development by creating an account on GitHub.

As you can see developer mentioned -

- **ColorWheel** a color wheel picker, use the arrow on the left to change saturation [ControlP5colorWheel](https://github.com/sojamo/controlp5/blob/master/examples/controllers/ControlP5colorWheel/ControlP5colorWheel.pde)
- **DropdownList** (use ScrollableList instead)
- **Group** for grouping and nesting controllers [ControlP5group](https://github.com/sojamo/controlp5/blob/master/examples/controllers/ControlP5group/ControlP5group.pde)
- **Icon** adds Icon support, an Icon behaves like a Button or Toggle [ControlP5icon](https://github.com/sojamo/controlp5/blob/master/examples/controllers/ControlP5icon/ControlP5icon.pde)
- **ListBox** (use ScrollableList instead)

---

<div class="post-metadata">

### Author: ![yjoeyj](https://avatars.discourse-cdn.com/v4/letter/y/839c29/32.png) [@yjoeyj](https://discourse.processing.org/u/yjoeyj)
#### Post date: [February 11, 2020, 7:57pm UTC](https://discourse.processing.org/t/the-function-enablecollapse-does-not-exist/17718/3 "2020-02-11T19:57:36Z")

</div>

Thanks! You saved my day

---

<div class="post-metadata">

### Author: ![raysoduran](https://avatars.discourse-cdn.com/v4/letter/r/8dc957/32.png) [@raysoduran](https://discourse.processing.org/u/raysoduran)
#### Post date: [July 25, 2021, 12:06am UTC](https://discourse.processing.org/t/the-function-enablecollapse-does-not-exist/17718/4 "2021-07-25T00:06:21Z")

</div>

Hola, Amigo como lograste corregir el error?, Tengo el mismo archivo pero me sigue dando error

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [August 18, 2021, 5:11pm UTC](https://discourse.processing.org/t/the-function-enablecollapse-does-not-exist/17718/5 "2021-08-18T17:11:27Z")

</div>

@raysoduran – La solución es la dada por @black. Probablemente esté usando una de las funciones en esa lista, y en su lugar debería usar una función diferente (por ejemplo, ScrollableList). Pero si aún tiene un problema, debe decir más sobre su problema en una nueva discusión separada.
