We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › controlP5 - scrollList not expanded
Page Index Toggle Pages: 1
controlP5 - scrollList not expanded (Read 429 times)
controlP5 - scrollList not expanded
Mar 19th, 2009, 2:35pm
 
How can i force a scrollList appearing closed when the program starts (not expanded/poped-up as default)?

thanks in advance
A
Re: controlP5 - scrollList not expanded
Reply #1 - Mar 20th, 2009, 12:02pm
 
good point, currently you can only hide the whole scrollList with hide(), show/hide the bar (showBar()/hideBar) and/or show/hide the scrollBar (showScrollbar()/hideScrollbar()). you can't yet show the top bar only - there is no option to expand and hide the scrollList items yet, but should be useful. i put it on the todo list.

a work around would be to put the scrollList into a ControlGroup at position 0,0. hide ScrollList's top bar and i think you get what you are looking for,.
Code:

 ScrollList myScrollList = controlP5.addScrollList("myList",0,0,120,280);
 myScrollList.hideBar();
 for(int i=0;i<20;i++) {
   controlP5.Button b = myScrollList.addItem("a"+i,i);
 }  
 
 ControlGroup l = controlP5.addGroup("myGroup",40,60,120);
 myScrollList.moveTo(l);
 l.close();

best,
andreas
Re: controlP5 - scrollList not expanded
Reply #2 - Mar 23rd, 2009, 7:41pm
 
Thanks for your hints! Actually it works also with just using the .close(). I really dont know why i did not manage to do this before.
I just puzzle about how to avoid graphical overlaps when using more (closed)scrollLists closely located to each other.
import controlP5.*;
ControlP5 controlP5;


void setup() {
size(400,400);
controlP5 = new ControlP5(this);
 
 ScrollList ScrollListOne = controlP5.addScrollList("myList_1",30,20,120,200);
 for(int i=0;i<20;i++) {
   controlP5.Button b = ScrollListOne.addItem("a"+i,i);
  }  
 ScrollListOne.close();
 
 ScrollList ScrollListTwo = controlP5.addScrollList("myList_2",30,100,120,280);
 for(int i=0;i<20;i++) {
   controlP5.Button b = ScrollListTwo.addItem("b"+i,i);
  }  
 ScrollListTwo.close();
 
}
void draw() {
 background(255);
 
}

P.S.:Thanks for your great library

Page Index Toggle Pages: 1