Hi.
I'm trying to display a ScrollList in a secondary controlWindow (to have minim input device selection in the setup tab in controlwindow)
For most controllers I don't need to do anything special, once the first tab is assigned to controlWindow
- controlP5.tab("camera").moveTo(controlWindow);
all controllers appear nicely on the second screen in the right tab if I invoke moveTo.
Is that a correct way to create tabs in the controlwindow? (question 1)
- controlP5.addSlider("cam_X_Pos",-500,500,10,100,300,20).moveTo("camera");
which I believe is pretty amazing so many many thanks for writing such a great library Andreas!
However I can't find a way to do the same for ScrollList
- ScrollList mixers = controlP5.addScrollList("Mixers", 10, 30, 475, 280);
because if I just do
- mixers.moveTo("camera") -> it doesn't show.
It does show when I do
- mixers.moveTo(controlWindow);
but then it's not in the right tab, so I've tried to move it to a secondary window in a different way
- mixers.setWindow(controlWindow); - > returns "function does not exist", fair enough
than
- controlP5.controller("Mixers").moveTo(controlWindow); -> returns NullPointerException
It it possible to have scrollList in an arbitrary tab in the controlWindow (question 2)
Does it mean I cannot access ScrollLists via controller()? (question 3)
and If i try:
- Controller mixers = controlP5.addScrollList("Mixers", 10, 30, 475, 280); - > i get "cannot convert from ScrollList to Controller".
Which is a bit inconsistent as you can do exactly that with sliders
on a side note I was getting also "Controller is ambiguous" when using it with minim.fft but that seems solvable by invoking "controlP5.Controller" instead. Is that a correct ? (question 4)
For the moment I shall proceed having scrollist stuck in the first tab and please let me know if I'm just doing it wrong.
And here's a minimal code showing the issue:
- import controlP5.*;
- ControlP5 controlP5;
- ControlWindow controlWindow;
- void setup() {
- size(400,400);
- frameRate(25);
- controlP5 = new ControlP5(this);
- controlWindow = controlP5.addControlWindow("controlP5window",100,100,400,200);
- controlP5.tab("tab1").moveTo(controlWindow);
- controlP5.tab("tab2").moveTo(controlWindow);
- Controller mySlider = controlP5.addSlider("sliderValue",0,255,40,40,100,10);
- ScrollList mixers = controlP5.addScrollList("Mixers", 10, 30, 475, 280);
- mixers.moveTo(controlWindow);
- // this doesnt work, is there a different way?
- // mixers.moveTo("tab2");
- mySlider.moveTo("tab1");
- }
Thanks!
1