See below...
I was hoping to combine the volume & the pull/push state into one tooltip to help see if the knob is pulled or not.
It works partially, but it is not updated live. When I adjust the volume while the tooltip is displayed, the tooltip is refreshed for the volume portion, but if I push/pull the knob, this portion is not refreshed. I need to move the mouse away from the tooltip and back over it for the updated string to be displayed.
Do you have any idea?
Ex:
- Code: Select all
<animation>
<type>knob</type>
<object-name>NavVolume</object-name>
<property alias="../../params/nav-volume"/>
<factor>-250</factor>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
<center>
<x-m>0.0188946</x-m>
<y-m>0.0180001</y-m>
<z-m>-0.0139999</z-m>
</center>
<action>
<binding>
<command>property-adjust</command>
<property alias="../../../../params/nav-volume"/>
<factor>0.1</factor>
<min>0.0</min>
<max>1.0</max>
<wrap>false</wrap>
</binding>
<binding>
<command>nasal</command>
<script>c172p.click("kx165-1-dial")</script>
</binding>
</action>
<shift-action>
<binding>
<command>property-toggle</command>
<property alias="../../../../params/nav-audio"/>
</binding>
</shift-action>
<hovered>
<binding>
<command>set-tooltip</command>
<tooltip-id>nav-volume</tooltip-id>
<label>%s</label>
<measure-text>NAV1 Volume: 100%, Ident disabled (Shift + click to pull)</measure-text>
<property alias="../../../../params/nav-volume"/>
<mapping>nasal</mapping>
<script>
var v = arg[0];
# TBD MGouin: this property does not seem to be refreshed "live"
var a = getprop("/instrumentation/nav[0]/ident-audible");
var s = "NAV1 Volume: ";
s = s ~ sprintf("%d", v * 100);
s = s ~ "%, Ident ";
if (a)
s = s ~ "enabled (Shift + click to push)";
else
s = s ~ "disabled (Shift + click to pull)";
return s;
</script>
</binding>
</hovered>
</animation>