WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:23 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC