WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Disable Clicking of Button (https://forum.worldviz.com/showthread.php?t=5826)

Eugene 08-25-2016 09:42 AM

Disable Clicking of Button
 
I've created a system status panel using buttons and would like to prevent the subject from accidentally clicking on the buttons. Currently, when I click on the 'Normal' button, it becomes unshaded.

May I know how could I disable the ability for someone to click it without causing the button to be gray-out.

import viz
import vizdlg

viz.go()

SystemIndicatorPanel = vizdlg.Panel()

SystemNormalButton = viz.addButtonLabel('NORMAL')
SystemNormalButton.set(1)
SystemErrorButton = viz.addButtonLabel('ERROR')
SystemErrorButton.set(0)
SystemIndicatorText = viz.addText('Overall System State')

SystemIndicatorPanel.addItem(SystemIndicatorText)
SystemIndicatorPanel.addItem(SystemNormalButton)
SystemIndicatorPanel.addItem(SystemErrorButton)

viz.link(viz.CenterTop,SystemIndicatorPanel,offset =(-150,-50,0))

Jeff 08-26-2016 07:53 AM

Are you saying you don't want to disable the button using the following and then later enable it?

Code:

SystemNormalButton.disable()
If so, then you would have to handle the button event and set the button state back to it's initial state.


All times are GMT -7. The time now is 08:03 AM.

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