Loading...
Logo
Processing Forum
Hi all, 

I've put an Accordion of Groups into a ControlWindow. Now what I wanna do is, to change the width of the Accordion relative to the width of the ControlWindow. getWidth() is not specified for ControlWindow, so I was wondering how to do that. 
Thanks. 

Replies(4)

You can use:
Copy code
  1. controlWindow.getFrame().getWidth();
Note that the frame may have extra border pixels.
A follow up question.  :)

I tried Andreas Schlegels Accordion example (with eclipse) and it worked fine. 

Then I tried to get the Accordion to the ControlWindow by adding
Copy code
  1. menu = cp5.addControlWindow("Menu", 700, 230, 300, 500);
and .moveTo to the accordion. 
Copy code
  1.  accordion = cp5.addAccordion("acc")
  2.                 .setPosition(40,40)
  3.                 .setWidth(200)
  4.                 .addItem(g1)
  5.                 .addItem(g2)
  6.                 .addItem(g3)
  7.                  .moveTo(menu)
  8.                 ;

The Accordion appears in the ControlWindow but buttons, sliders...don't work. Any ideas what I did wrong?

thanks again
I see what you mean. When you moveTo() the individual groups they work correctly, but the accordion as a whole (list of groups) does not. I think there may be some missing code behind the scenes to facilitate this. So this is something for Andreas. You could wait if he sees this thread of submit an issue here.