slaclab / pydm

Python Display Manager
http://slaclab.github.io/pydm/
Other
111 stars 76 forks source link

PyDMPushButton property #1081

Closed forestmojo closed 1 month ago

forestmojo commented 1 month ago

Does PyDMPushButton has default property such as pressText and releaseText? I am using PyDM 1.16.2, PYthon 3.8.10, PyQT 5.14.1.

nstelter-slac commented 1 month ago

Hi, This functionality is not present in PyDMPushButton, as a deliberate design choice to prevent user error with unclear text-setting. (for example: if you set a button-text to "off" after its clicked, this might be interpreted as either "this button is off" or incorrectly as "click this button to turn off")

A workaround could be to have a python display-file and make subclass of PyDMPushButton, and then implement these properties in the subclass. Some reference on how parts of this might look: https://github.com/slaclab/pydm/pull/773

forestmojo commented 1 month ago

Thanks for your replay. I will close this issue.