ParamWidget and onDoubleClick

While testing my plugin under 1.0, I discovered that rapidly pressing a button appeared to work most, but not all, of the time.

My bug was that I was not overriding ParamWidget::onDoubleClick. Its default behavior is to call ParamWidget::reset which I was overriding, and which in turn was turning my button off.

Adding an empty override:

    void onDoubleClick(const event::DoubleClick& ) override {

solved my problem. Adding this here in case it helps someone else, or in case there’s a better way.

Switch does this for you. If you’re implementing a button of some sort, subclass Switch or any of its descendants. What are you subclassing?

I’m subclassing ParamWidget directly. In 0.6, the only choices I saw were MomentarySwitch and ToggleSwitch, neither of which met my needs, so I rolled my own. I’ll try switching to Switch. Thanks!