Latching knock-off button

More
22 Jul 2020 17:15 #175403 by frogandspanner
I am entering the cosmetic phase of a project - tidying up loose ends.

I have been developing a spindle controller for a Sieg SX2P baby mill, and have used a PyVCP dial to show the spindle speed (Actually: I have modified the dial widget to have two needles to show target speed and tacho speed). I have been adding a calibration protocol in which the spindle controller increases the control voltage, and reports it and the resultant tacho rpm to linuxCNC. This means that linuxCNC can subsequently send target rpm and voltage to the controller to make getting to speed quicker.

To the point: I control the calibration request with a PyVCP check-box that sets a hal pin that tells the spindle controller to get going.
The spindle controller responds, and this sets another hal pin that illuminates an LED widget.
When the calibration process has completed the LED widget is switched off.

What I would really like: I would like a latching button widget - like the normal button, but one that remains down (shaded accordingly).
I would like a second click to unlatch it.
I would then like a means of a hal-pin change unlatching, or knocking the button off.

Perhaps there is already a means of doing that, and if not I'd appreciate it if somebody could point me at where I might look to make changes.

Tony

Please Log in or Create an account to join the conversation.

More
22 Jul 2020 17:30 #175405 by cmorley
Replied by cmorley on topic Latching knock-off button
Sounds like you need a toggle button.
Seems as though the tkinter toolkit doesn't have a built in toggle button.
If you are modifying source code anyways, maybe these can help:
www.daniweb.com/programming/software-dev...kinter-toggle-button

Please Log in or Create an account to join the conversation.

Time to create page: 0.070 seconds
Powered by Kunena Forum