# Show only value on popuptext - not channel name

**URL:** <https://forum.cabbageaudio.com/t/show-only-value-on-popuptext-not-channel-name/3073>\
**Category:** Cabbage Stew\
**Created:** [9 February 2022 16:19 UTC](https://forum.cabbageaudio.com/t/show-only-value-on-popuptext-not-channel-name/3073 "2022-02-09T16:19:42Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![chronopolis](https://forum.cabbageaudio.com/letter_avatar_proxy/v4/letter/c/c37758/32.png) [@chronopolis](https://forum.cabbageaudio.com/u/chronopolis)\
**Post date:** [9 February 2022 16:19 UTC](https://forum.cabbageaudio.com/t/show-only-value-on-popuptext-not-channel-name/3073/1 "2022-02-09T16:19:42Z")

</div>

Hey Rory - is it possible to show only the value but not the channel name on the popup text?  
 ![cOctrmyYMs](https://forum.cabbageaudio.com/uploads/default/original/2X/8/8fe5feb08cb3f065bb0740368e378f9c50c26fdb.gif)

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [9 February 2022 17:05 UTC](https://forum.cabbageaudio.com/t/show-only-value-on-popuptext-not-channel-name/3073/2 "2022-02-09T17:05:00Z")

</div>

Yes, create your own `popupText()` dynamically in your Csound code using `cabbageSet`, I think you can also override this using the `popupPrefix()` identifier, although I’m not 100%. Gotta rush now, might get a chance to test this later…

---

<div class="post-metadata">

**Author:** ![chronopolis](https://forum.cabbageaudio.com/letter_avatar_proxy/v4/letter/c/c37758/32.png) [@chronopolis](https://forum.cabbageaudio.com/u/chronopolis)\
**Post date:** [10 February 2022 18:15 UTC](https://forum.cabbageaudio.com/t/show-only-value-on-popuptext-not-channel-name/3073/3 "2022-02-10T18:15:38Z")

</div>

Thinking of making my own popup with a label that shows up above or below the mouse. Do you see any obvious caveats to doing it this way?

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [10 February 2022 21:14 UTC](https://forum.cabbageaudio.com/t/show-only-value-on-popuptext-not-channel-name/3073/4 "2022-02-10T21:14:33Z")

</div>

That should work fine, but it might be simpler to use the existing mechanisms?

![test](https://forum.cabbageaudio.com/uploads/default/original/2X/f/f54b8a781eb71fb699230dc6b0ac3d3bee30dd23.gif)

---

<div class="post-metadata">

**Author:** ![chronopolis](https://forum.cabbageaudio.com/letter_avatar_proxy/v4/letter/c/c37758/32.png) [@chronopolis](https://forum.cabbageaudio.com/u/chronopolis)\
**Post date:** [14 February 2022 17:39 UTC](https://forum.cabbageaudio.com/t/show-only-value-on-popuptext-not-channel-name/3073/5 "2022-02-14T17:39:40Z")

</div>

Thanks Rory,

Just having some trouble understanding how to get this working with an array of controls. The docs don’t specify whether an cabbageChanged needs an array output or… Shouldn’t cabbageGetValue return the name _and_ value of the changed channel? It seems like I need to do it twice to get one of each…

```
SliderChannels[] cabbageGetWidgetChannels "rslider"
Scontrol, krsliderChanged cabbageChanged SliderChannels
kRsliderVal, kvalChanged cabbageGetValue Scontrol
cabbageSet krsliderChanged, Scontrol, sprintfk("popupText(%f)", kRsliderVal)

```

EDIT: Solved - I had it just outside the endin block 🤦‍♂️

Is there a way to remove decimal spaces from the popupvalue? Right now there’s 6 decimal spaces!

Even if I do this `floor(100*kRsliderVal)/100)` it still shows all the empty zeros at the end.

---

<div class="post-metadata">

**Author:** ![chronopolis](https://forum.cabbageaudio.com/letter_avatar_proxy/v4/letter/c/c37758/32.png) [@chronopolis](https://forum.cabbageaudio.com/u/chronopolis)\
**Post date:** [14 February 2022 20:17 UTC](https://forum.cabbageaudio.com/t/show-only-value-on-popuptext-not-channel-name/3073/6 "2022-02-14T20:17:08Z")

</div>

Also - wondering if you know what’s causing this on the hover over a control? it’s making the spectrum display above it flicker…  
[https://recordit.co/riPbfD4HC4](https://recordit.co/riPbfD4HC4)

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [14 February 2022 21:29 UTC](https://forum.cabbageaudio.com/t/show-only-value-on-popuptext-not-channel-name/3073/7 "2022-02-14T21:29:52Z")

</div>

> [@chronopolis](#):
>
> Shouldn’t cabbageGetValue return the name _and_ value of the changed channel?

No, it only returns the index, or name of the channel that changed. I guess I was trying to follow Csound’s native changed opcode, which only notifies of the change, but doesn’t give the new value.

> [@chronopolis](#):
>
> Is there a way to remove decimal spaces from the popupvalue? Right now there’s 6 decimal spaces!

Use a format specifier, something like this should work:

`cabbageSet kTrig, "rslider10000", sprintfk("popupText(\"%.2f\")", kSlider)`

> [@chronopolis](#):
>
> Also - wondering if you know what’s causing this on the hover over a control? it’s making the spectrum display above it flicker…  
> [https://recordit.co/riPbfD4HC4](https://recordit.co/riPbfD4HC4)

Does this only happen with the sliders that are close to the spectrogram?

---

<div class="post-metadata">

**Author:** ![chronopolis](https://forum.cabbageaudio.com/letter_avatar_proxy/v4/letter/c/c37758/32.png) [@chronopolis](https://forum.cabbageaudio.com/u/chronopolis)\
**Post date:** [14 February 2022 22:19 UTC](https://forum.cabbageaudio.com/t/show-only-value-on-popuptext-not-channel-name/3073/8 "2022-02-14T22:19:35Z")

</div>

> [@rorywalsh](#):
>
> Does this only happen with the sliders that are close to the spectrogram?

Yeah. The rectangle that the popup is contained in makes that effect.

Not urgent for now. I ended up rolling my own value readout w a label widget and it looks pretty good.

---

<div class="post-metadata">

**Author:** ![chronopolis](https://forum.cabbageaudio.com/letter_avatar_proxy/v4/letter/c/c37758/32.png) [@chronopolis](https://forum.cabbageaudio.com/u/chronopolis)\
**Post date:** [14 February 2022 22:23 UTC](https://forum.cabbageaudio.com/t/show-only-value-on-popuptext-not-channel-name/3073/9 "2022-02-14T22:23:37Z")

</div>

> [@rorywalsh](#):
>
> Use a format specifier, something like this should work:
> 
> `cabbageSet kTrig, "rslider10000", sprintfk("popupText(\"%.2f\")", kSlider)`

perfect, thanks!

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [15 February 2022 10:48 UTC](https://forum.cabbageaudio.com/t/show-only-value-on-popuptext-not-channel-name/3073/10 "2022-02-15T10:48:40Z")

</div>

> [@chronopolis](#):
>
> Not urgent for now. I ended up rolling my own value readout w a label widget and it looks pretty good.

I’m happy you found a solution. Those kind of painting glitches can be a real pain to fix.
