Comments (4)
Sounds like a special case which could be customised by extending the ScrollableList class. as a quick workaround I would clear and remove all items from the list which gives you the effect you are looking for? Here a a modified example from the examples that come with controlP5:
import controlP5.*;
import java.util.*;
ControlP5 cp5;
void setup() {
size(400, 400);
cp5 = new ControlP5(this);
List l = Arrays.asList("a", "b", "c", "d", "e", "f", "g", "h");
/* add a ScrollableList, by default it behaves like a DropdownList */
cp5.addScrollableList("dropdown")
.setPosition(100, 100)
.setSize(200, 100)
.setBarHeight(20)
.setItemHeight(20)
.addItems(l)
;
}
void draw() {
background(240);
}
void dropdown(int n) {
/* request the selected item based on index n */
println(n, cp5.get(ScrollableList.class, "dropdown").getItem(n));
/* remove all items from the list after the first event *
* a quick workaround to disable the dropdown function */
cp5.get(ScrollableList.class, "dropdown").clear();
}
from controlp5.
Hi Sojamo,
thanks for the quick response and thanks for the great library. I'm using it to make a phone app to control animal showers at the Melbourne Zoo - this library is making my life super easy and the Giant Tortoises happy!
Reading back over my question I see that it was unclear. I am using a button (somewhere else on screen) to show and hide the ScrollableList. This works well however I want to disable the collapse, i.e. I never want the list to be just the top bar. Is there a way to stop the list from collapsing if the user taps the top bar?
thanks, Scott
from controlp5.
I'm having the same issue as Scott. Any update on this?
from controlp5.
unfortunately this is currently not possible. Will look into it.
from controlp5.
Related Issues (20)
- SOME WORNG
- How to properly stop ControlP5
- How to extend the Slider
- All my buttons press themselves once on startup HOT 1
- How to change text size HOT 1
- Slider2D: Make cursorWidth height editable
- When using 2 RadioButtons it does not like the fact that addItems are the same
- How to call textbox HOT 1
- mouse-over detection not working for repsonsive window layout
- The function "tab(String)" does not exist HOT 1
- How to run a processing script using controlp5 button
- Library not working correctly in Android Mode HOT 2
- Examples don't work under Android
- Processing ControlP5 Issue - no other term for it
- slider.FLEXIBLE with more than 11 tick marks no longer aligns the pointer with the marks
- I can't use certain functions like ".setColorForeground(color)" , ".setColorCaptionLabel(color)" or ".setRadius(radius)"
- I'm trying to create a custom rounded toggle switch, but the program says the function doesn't exist
- Text doesn't delete itself after sliding.
- Can it handle multitouches
- How to Highlight text in a Textfield?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from controlp5.