ofxControlPannel problems with addButtonSlider

HI all ,
Something is wrong when I try to load saved values from sliders at ofxControlPannel.

I use addButtonSlider to save floats or ints, but values are not well loaded each time I reload Xml values.

  
//load from xml!  
gui.loadSettings("controlPanelSettings.xml");  

it reload all that values, but doesn’t happend with the sliders, should I do something different?

Checking it, all that sliders return just default value from each addButtonSlider funtion, instead the writed value from the saved xml.

still no way, may be I should save that default values to a personal external XML. This should will work for me.

  
  
float auxSavedthreshold = loadThresholdValueFromAnotherXML("xmldataSlider");  
gui.addButtonSlider("threshold", "BG_THRESHOLD", auxSavedthreshold, 1.0, 255.0, false);	  
  

but i guess, I still wrong how use them…

pd: source code from ofxControlPannel example.

I’m not sure I understand - are you saying that this works with some UI elements (which ones?), but not with ButtonSlider?
At a quick glance at the source code on github, I couldn’t find an implementation of loadSettings for ButtonSlider which is doing anything, so no wonder it doesn’t work.

hi!
Yes, this works for addTextDropDown (threshold mode) and addToggle loadSettings, but not for addButtonSlider with the LoadSettings fucntion or trying directly with getValue function.

  
gui.getValueF("BG_THRESHOLD", 0);  

Just recorver the default value from addButtonSlider and not the value inside the XML

I couldn’t find an implementation of loadSettings for ButtonSlider which is doing anything, so no wonder it doesn’t work.

but at loadSettings, is getValue"type" functions used to recover data. and at the XML the data are well saved…

does a regular slider work?
the button slider was contributed by someone else ( though I have used it before and don’t remember any issues ).

Can you please post full code to recreate the issue. Its not easy when you just include a single line snippet :slight_smile:

hi Theo, thanks.

does a regular slider work?

I’m not sure what you mean… Don’t use the addButtonSlider function and try another way. Which one?

The code is the same as is post at ofxControlPannel-example, just I would like to load automatically the threshold saved from the xml panel when the app re-starts again, what I guess is more practise to save the last right data, such as the other options from panel.