i’m working on a new plugin with another dev, and i thought of adding a slider to the right click menus of a couple of our modules, to control the value of a float. but it turns out neither of us has any experience implementing sliders in the context menu.
are there any basic examples out there of this that i can draw from? or could somebody explain how to do it?
There are multiple modules that use a context menu slider for color theme contrast control. Meander does this, but there are probably simpler modules to use as example. I forget where I learned how to do this.
that’s what i was trying to look at but it seemed complicated to me. all the other context menu items i’ve added so far have been very very simple to do, but the examples i’ve found so far for this seem much more involved. each one i’ve seen so far involved creating structs and stuff, and i was hoping there was a simpler way. guess i’ll look closer, thanks
I use menu sliders in my Light Strip module but they are probably more complex than you need.
Have a look at how the sliders are done in the MindMeld MixMaster - the GainAdjustSlider implementation is quite simple. The GainAdjustSlider constructor accepts a pointer to the variable into which the slider value is to go. GainAdjustQuantity is used to describe the sliders behaviour.