taurus-org / taurus

Moved to https://gitlab.com/taurus-org/taurus
http://taurus-scada.org
43 stars 46 forks source link

Button to swicth boolean attribute state #1124

Closed hayg25 closed 4 years ago

hayg25 commented 4 years ago

Dear All, I would like to create a button to modify an attribute state (Boolean). I tried TaurusCommandButton using a command ( = a function I implemented that modifies the Boolean value using PyTango).

What's the correct way ?

Thx

cpascual commented 4 years ago

We normally use TaurusValueCheckbox for this, because it is more evident which is the current setting.

If you specifically want a button, it can be created quite easily inheritting from QPushButton and TaurusBaseWidget (or maybe TaurusBaseWritableWidget)... if you want help with that, I could give a quick snippet (but I personally would prefer the TaurusValueCheckbox)

hayg25 commented 4 years ago

Dear @cpascual , thx for your answer, ok I use TaurusValueCheckbox then.

Cheers