python hal glade
- rockcnc
- Offline
- New Member
-
Less
More
- Posts: 17
- Thank you received: 0
28 Feb 2025 07:09 - 28 Feb 2025 07:18 #322851
by rockcnc
python hal glade was created by rockcnc
I was using linuxcnc 2.8.4 on linux mint 19.1 and I decide to update to a higher version, so I use this version
forum.linuxcnc.org/9-installing-linuxcnc...int-debian-edition-6
After hours of trying I stuck in this one
It looks like it can't recognize hal python and hal button
this is my code
forum.linuxcnc.org/9-installing-linuxcnc...int-debian-edition-6
After hours of trying I stuck in this one
It looks like it can't recognize hal python and hal button
this is my code
Attachments:
Last edit: 28 Feb 2025 07:18 by rockcnc.
Please Log in or Create an account to join the conversation.
- andypugh
-
- Away
- Moderator
-
Less
More
- Posts: 23270
- Thank you received: 4928
07 Mar 2025 19:53 #323458
by andypugh
Replied by andypugh on topic python hal glade
You may have cut off the most important part of the error chain, the real problem is likely to be near the bottom.
Please Log in or Create an account to join the conversation.
- rockcnc
- Offline
- New Member
-
Less
More
- Posts: 17
- Thank you received: 0
14 Mar 2025 10:16 #323902
by rockcnc
Replied by rockcnc on topic python hal glade
This is the full error
Attachments:
Please Log in or Create an account to join the conversation.
- andypugh
-
- Away
- Moderator
-
Less
More
- Posts: 23270
- Thank you received: 4928
02 Apr 2025 21:04 #325546
by andypugh
Replied by andypugh on topic python hal glade
Yes, almost at the bottom:
AttributeError: Handler hal_button_pressed not found
So, in your .ui file there is a button that triggers the event "hal_button_pressed" and no handler for that event in the python.
Looking through the .ui file in a text editor:
in the Python I see:
So you have written the handler, but in my editor the entire code body in the Python file appears to be triple-quoted (lines 15 and 120) and is highlighted in red. It may be that this is causing the whole handler file to be ignored.
AttributeError: Handler hal_button_pressed not found
So, in your .ui file there is a button that triggers the event "hal_button_pressed" and no handler for that event in the python.
Looking through the .ui file in a text editor:
cnc11.ui:34: <signal name="pressed" handler="hal_button_pressed" swapped="no"/>
cnc11.ui:49: <signal name="pressed" handler="hal_button_pressed" swapped="no"/>
cnc11.ui:93: <signal name="pressed" handler="hal_button_pressed" swapped="no"/>
cnc11.ui:108: <signal name="pressed" handler="hal_button_pressed" swapped="no"/>
cnc11.ui:123: <signal name="pressed" handler="hal_button_pressed" swapped="no"/>
Found 5 matches for "hal_button_pressed".
in the Python I see:
def hal_button_pressed(self, widget, data=None):
print ("on_button_press calllllllled")
s.poll()
So you have written the handler, but in my editor the entire code body in the Python file appears to be triple-quoted (lines 15 and 120) and is highlighted in red. It may be that this is causing the whole handler file to be ignored.
Please Log in or Create an account to join the conversation.
Moderators: HansU
Time to create page: 0.106 seconds