Loading...
Processing Forum
Recent Topics
All Forums
Move this topic
Forum :
Share your Work
Programming Questions
Core Library Questions
Contributed Library Questions
Android Processing
Processing with Other Languages
Integration and Hardware
Library and Tool Development
Events and Opportunities
General Discussion
Sub forum :
Move this topic
Cancel
Contributed Library Questions
processin..
Is it possible to retain the dropdownmenu header?
in
Contributed Library Questions
•
1 year ago
Hi,
I am creating several menus using ControlP5 dropdownlist. Currently when I select an item from the list, the menu header changes to reflect the current selection. Is it possible to retain the original header?
Thanks a lot.
1
Replies(1)
andreas.s..
Re: Is it possible to retain the dropdownmenu header?
1 year ago
Hi, use a ControlListener to capture events from the dropdownlist and then reset the header:
import controlP5.*;
ControlP5 cp5;
DropdownList d1;
void setup() {
size(400,400);
cp5 = new ControlP5(this);
d1 = cp5.addDropdownList("myList-d1")
.setPosition(100, 100)
;
for (int i=0;i<40;i++) {
d1.addItem("item "+i, i);
}
d1.addListener(new ControlListener() {
public void controlEvent(ControlEvent theEvent) {
d1.setLabel(d1.getName());
}
});
}
void draw() {
background(120);
}
Leave a comment on andreas.schlegel's reply
Change topic type
Topic Type :
Discussions
Questions
No of days :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Change topic type
Cancel
Link this topic
Provide the permalink of a topic that is related to this topic
Permalink
Save
Close
Reply to processingnewb's question
Top
Reply
{"z8349217":[25080000001643084],"z4096907":[25080000001644139]}
Statistics
1
Replies
269
Views
0
Followers
Tags
No tags available for this topic.
Cancel
Actions
Permalink