no hand icon to grab slider

Questions about deployment and use of Air Manager Instruments

Moderators: russ, Ralph

Post Reply
Message
Author
Roxus
Posts: 58
Joined: Wed Sep 02, 2020 7:30 pm

no hand icon to grab slider

#1 Post by Roxus »

I'm not getting the hand icon when I hover over a slider, and I am unable to slide it (touch or mouse) with AM4.0.1

Code: Select all

function callback(position)
log(position)
slider_set_position(slider_id, position)
if (position > 0.9 or position < 0.1) then
xpl_dataref_write("sim/cockpit2/switches/rotor_brake","INT",fif(position > 0.9,1,0))
end
end
slider_id = slider_add_ver(nil, 0, 0, 0, 1000, "handle.png", 70, 150, callback)
xpl_dataref_subscribe("sim/cockpit2/switches/rotor_brake", "INT", callback)
I'm only getting logging when XP11 dataref changes, and then the slider moves. But from XP, its a binary on/off, so all it gets is either end
What am I missing ?

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: no hand icon to grab slider

#2 Post by Sling »

Hi Roxus,

That's because you have the width set to 0. Try increasing to 70 or more. i.e. the same or a bit larger than the thumb image width.

Tony

Roxus
Posts: 58
Joined: Wed Sep 02, 2020 7:30 pm

Re: no hand icon to grab slider

#3 Post by Roxus »

That was it, thank Tony

Post Reply