PDA

View Full Version : Detect a double click on a gui slider


Renato Lima
11-07-2010, 04:48 PM
Is it possible to detect a double click on a slider?

Renato Lima
11-07-2010, 06:10 PM
Please, benjamin. Enlighten me with your knowledge.

Jeff
11-08-2010, 03:49 PM
A silder event is only generated when the slider changes position. If you doubleclick on the same spot no event will be generated for the second click so you can't tell it occurred.

Renato Lima
11-09-2010, 02:19 PM
What if I try to check if mouse is over a slider after doubleclick?

Renato Lima
11-09-2010, 02:23 PM
This is how I solved my problem:


def onDoubleClick(e):
if e.button == viz.MOUSEBUTTON_LEFT: print 'Left button double clicked'
print Gui["YRBox_Speed"].dragging()

viz.callback(viz.DOUBLE_CLICK_EVENT,onDoubleClick)
#viz.callback(viz.SLIDER_EVENT,onSlider)