I want to put some elements (Slider, toggle Button) inside a Popup . I’m using for this propose a CallOutBox launchAsynchronously. The problem is, the CallOutBox doesn’t shows the slider and toggle, and the Application crashes always when I leave the CallOutBox. Maybe someone can explain me how has to be used, for example I tried to use it in the following way:
std::shared_ptr<Slider> mySlider = std::make_shared<Slider>(); std::shared_ptr<Label> myLabel = std::make_shared<Label>(); mySlider->setRange(40, 220); mySlider->setTextValueSuffix("bmp"); mySlider->addListener(this); myLabel->setText("BPM", dontSendNotification); myLabel->attachToComponent(mySlider.get(), true); std::shared_ptr<ComponentSlider> myComponentSlider = std::make_shared< ComponentSlider >(slider, 200, 100); CallOutBox::launchAsynchronously (myComponentSlider.get(), metronomeButton->getBoundsInParent(), fWindow);
The class ComponentSlider is only adding a Slider to a Component, and making it Visible. I’m calling CallOutBox always when I press some buttons should the CalloutBox appear with the slider. I tried to declare the Slider, Label and ComponentSlider on the stack, but the CallOutBox still doesn’t works. Maybe someone can show me a working example how this function has to be used.