Is there a way to set the popup tooltip text on widgets to something other than their channel name?
Is there a way to set "tooltip" text?
Not currently. Are you looking to provide more detailed information on the tooltip?
Exactly. Iām working on an instrument where the visible control widgets change based on a selectable mode, and having the tooltip describe the different visible controls at the time in a more human meaningful way would be very helpful.
My specific use case for this is rsliders which already popup with the channel name, but Iād imagine a few other widgets could benefit from it too.
So you are setting different widgets visibility based on user selection. Have you thought about using the text() identifier to show the purpose of the rslider?
I considered it, but for space constraints and similarity of function of each widget, it seemed overkill to have it always visible. The effect Iām working on is a delay that works in either seconds, taps IN beats at tempo, or taps PER beat at tempo⦠all modes have a āDelay Lā and āDelay Rā labeled widget which makes sense for text(), but in each mode they work slightly differently, so more descriptive text in the popup would be very useful.
As for space constraints, text() can only a word or two⦠Iām hoping at least a few more would fit in the popup?
Currently you canāt do this but I can look at overriding the text that appears on the popup with a new identifier called popuptext(). I guess the value should also appear in the new popup? I tried doing it another way using identchannel()s but I donāt think itās ideal.
tapsSeconds.csd (1.0 KB)
Thatās a great question⦠I guess so, hadnāt thought about that. Itās typically useful to have, so Iād say keep it. If you wanted to get real crazy, you could add in an optional token to signal not display the value, like maybe ā$ā (picked for representing EOL in *nix). For example popuptext(āBlah blah blahā) would display with a value and popuptext(āLorem Ipsum$ā) would not. Tho I guess since $ is used for preprocessor parsing, it might have to be escaped or doubled up or something to be used properly, so maybe a different character would be a better pick.
I might be missing something, but I donāt think your example is actually changing the popup text, is it? It seems like itās still dependent on the channel names.
Itās not straightforward to go parsing strings like that without a bona fide parser. Cabbage uses a fairly ad-hoc parser for these things. But I think there may be another way. Iāll look into it. If the strings are being created in Csound then you could either send the value or leave it out.
That example does change the popup text. Just toggle between the two checkboxes.
What I mean is that in your example the popup text is still identical to the channel name, youāre changing which widget is visible. It technically changes what the popup text is, but isnāt really achieving my goal. I am asking to be able to have the popup text be different than both the widget channel name and text below the widget. For example, the widgets text is āDelay Lā for all three widgets, the channel might be either DelayTL, DelayBL, DelayPBL, and the popup text would be more human for each, such as āTime in secondsā, āBeats per tap at tempoā, and āTaps per beat at tempoā.
Also, I get that the parser is simple and not very flexible, but just spitballing ideas here⦠you could also possibly tokenize the channel name and value. For example the default right now is equivalent to popuptext("&c: &v"), but a user could also do something like popuptext(āChannel &c has a value of &vā). The tokenizing might not be likely, but just giving you some ideas to think about.
Yup. Thatās exactly whatās happening. Not a fix for your problem. Just thought I would post it anyway!
I think I will just add a new popuptext() identifier. If you wish to display the value when the users changes the slider you can do so using an identchannel and Csound code. Why spends days creating a new way of doing in Cabbage syntax when Csound can do it for us
Something like this seems to work well. I just need to run a few more text. Youāll see Iāve added the same identifier to regular widgets too in case that proves useful.
That looks like it will do exactly what Iām looking for!
I agree, if you need/want the value in there it can be put in via the sprintf statement. I wasnāt thinking that through, that approach is much simpler and more direct.
I wonāt be at my OSX machine until tomorrow, but Iāll try to fire off a build for you before the weekend.
Awesome, thanks! I can wait for a build no problem⦠especially this doesnāt functionally change my instruments, but I think it could help us build UIs that are more user friendly to non csound/cabbage users.