# Question about SliderAttachment constructor

**URL:** <https://forum.juce.com/t/question-about-sliderattachment-constructor/59552>\
**Category:** Audio Plugins\
**Created:** [January 17, 2024, 1:54am UTC](https://forum.juce.com/t/question-about-sliderattachment-constructor/59552 "2024-01-17T01:54:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zsliu98](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/zsliu98/32/22502_2.png) [@zsliu98](https://forum.juce.com/u/zsliu98)\
**Post date:** [January 17, 2024, 1:54am UTC](https://forum.juce.com/t/question-about-sliderattachment-constructor/59552/1 "2024-01-17T01:54:55Z")

</div>

I notice that in the contructor function of `SliderParameterAttachment`:

> <https://github.com/juce-framework/JUCE/blob/master/modules/juce_audio_processors/utilities/juce_ParameterAttachments.cpp#L112>

At line 120, the attachment **enables** the double-clicking and set the default value of it. However, I would not expect an attachment to change whether double-clicking is enabled. Why not query it from the slider (I haven’t tried the following code):

```c++
slider.setDoubleClickReturnValue (slider.isDoubleClickReturnEnabled(), param.convertFrom0to1 (param.getDefaultValue()));

```

---

<div class="post-metadata">

**Author:** ![Mrugalla](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/mrugalla/32/13092_2.png) [@Mrugalla](https://forum.juce.com/u/Mrugalla)\
**Post date:** [January 17, 2024, 7:18am UTC](https://forum.juce.com/t/question-about-sliderattachment-constructor/59552/2 "2024-01-17T07:18:51Z")

</div>

in every parameter change the attachment needs to change the actual parameter value with gestures. but i think you can still disable doubleclicks from your slider after adding the attachment

---

<div class="post-metadata">

**Author:** ![zsliu98](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/zsliu98/32/22502_2.png) [@zsliu98](https://forum.juce.com/u/zsliu98)\
**Post date:** [January 19, 2024, 3:37am UTC](https://forum.juce.com/t/question-about-sliderattachment-constructor/59552/3 "2024-01-19T03:37:21Z")

</div>

Thanks for your suggestion. Yes, it does make sense. I always add the attachment after setting all attributes of the slider. And it actually takes me a while to figure out why double-clicking is enabled again 😄

---

<div class="post-metadata">

**Author:** ![Mrugalla](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/mrugalla/32/13092_2.png) [@Mrugalla](https://forum.juce.com/u/Mrugalla)\
**Post date:** [January 19, 2024, 9:36am UTC](https://forum.juce.com/t/question-about-sliderattachment-constructor/59552/4 "2024-01-19T09:36:06Z")

</div>

understandable. i have written my own attachments. that’s why i’m familiar with the processes of such a class’s constructor
