View Single Post
  #4  
Old 04-19-2007, 09:30 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

If you want to know when a slider is released, then handle the viz.BUTTON_EVENT and check for the slider object. Example:
Code:
import viz
viz.go()

slider = viz.addSlider(pos=(0.5,0.1,0))

def onButton(obj,state):
	if obj == slider and state == viz.UP:
		print 'slider released'
viz.callback(viz.BUTTON_EVENT,onButton)
If you still need to handle the mouse up event, then you need to register your callback with a lower priority number than the GUI priority. Example:
Code:
import viz
viz.go()

slider = viz.addSlider(pos=(0.5,0.1,0))

def onMouseUp(button):
	if button == viz.MOUSEBUTTON_LEFT:
		print 'left button released'
viz.callback(viz.MOUSEUP_EVENT,onMouseUp,priority=viz.PRIORITY_GUI_HANDLER-1)
Reply With Quote