- Posts: 39
- Thank you received: 1
Please Log in or Create an account to join the conversation.
ArcEye wrote: Hi
If you want to use the checkbox, then you could change the way it works
The below code, substituted in pyvcp_widgets.py, will create an extra IN pin called pyvcp.{whateveryounamedcheckbox}.changepin
It toggles the state of the checkbox, when set TRUE.
(it will not toggle again until pin goes FALSE to prevent a race condition)
Activating will either check or uncheck the checkbox, depending upon its current state, user click on the checkbox will revert the state.Code:...code snipped...
As with all parsel-tongue, be very careful of indentation if you cut and paste this
You can amend to suit.
For instance: if you will only ever want to uncheck the box, just change the conditional test in update()
so that it only toggles the value in self.v if that value is true.
regards
EDIT added another reset of IN pin to ensure it is done, whatever the result of the conditional test
Please Log in or Create an account to join the conversation.
One newbie question, however. I see in the lib directory that there is a pyvcp_widgets.py file and a pyvcp_widgets.pyc file. If this change is made to the .py file, is there some kind of compile step required to make the .pyc file before it can be used?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.