Using mouse button events while developing sketches in the Eclipse IDE

Thank you for this code. It is a big help to see it all together. I migrated this code into the Eclipse IDE and it works perfectly. But due to the application I need it for some questions are raised.

The application is to display a menu of available serial ports to select from. The list of available ports can change between times the menu is displayed. This means the calls to menu.add() have to called in the draw() function. Also, to refresh the list, menu.removeAll() will have to be called, and then the calls to menu.add done all over again. Would a call to item.removeAll() also be necessary for each menu item to prevent memory leaks? Or just the one call to menu.removeAll() sufficient?

1 Like