Question regarding Python callbacks
25 Jan 2019 01:31 #124780
by dokwine
Question regarding Python callbacks was created by dokwine
So. I'm working my way through GladeVCP programming (not very far yet :/ ) and am having difficulty with the simple call back in 8.2 of the docs. I'm pretty sure my Python environment is set up ok with 2.7. I can do things like dump linuxcnc.stat. When I attempt the "simple handler model" with my config though, nothing happens.
I'm sure I'm missing something basic here again, but so far I haven't even been able to throw an interesting error message.
FWIW, glade, python and ini attached
Thanks,
Ron
- The handler is called out correctly in the.ini GLADEVCP= -u
- The handler function name is in agreement with the signal name in GtkButton "pressed"
- Nothing complains when I run my configuration/glade panel, but the button label does not change as described in the doc
I'm sure I'm missing something basic here again, but so far I haven't even been able to throw an interesting error message.
FWIW, glade, python and ini attached
Thanks,
Ron
Please Log in or Create an account to join the conversation.
- islander261
- Offline
- Platinum Member
Less
More
- Posts: 757
- Thank you received: 216
25 Jan 2019 01:43 #124782
by islander261
Replied by islander261 on topic Question regarding Python callbacks
Look at the GMOCCAPY PLASMA example (sim), it has several extra Glade files with Python handlers. This should provide a good working example, at least it did for me.
John
John
Please Log in or Create an account to join the conversation.
25 Jan 2019 03:59 #124790
by cmorley
Replied by cmorley on topic Question regarding Python callbacks
just a quick look this looks wrong:
GLADEVCP= -u hitcounter.py Fred1.ui /ROUTINES/DemoHandler.py
Do you wish to load hitcounter.py and DemoHandler.py ?
Also I feel that the path /ROUTINES/DemoHandler.py seemd wrong, but that depends on where you launched the config from.
is there any pertinent info from the terminal?
Chris M
GLADEVCP= -u hitcounter.py Fred1.ui /ROUTINES/DemoHandler.py
Do you wish to load hitcounter.py and DemoHandler.py ?
Also I feel that the path /ROUTINES/DemoHandler.py seemd wrong, but that depends on where you launched the config from.
is there any pertinent info from the terminal?
Chris M
The following user(s) said Thank You: dokwine
Please Log in or Create an account to join the conversation.
25 Jan 2019 05:45 #124793
by dokwine
Replied by dokwine on topic Question regarding Python callbacks
I am so red-faced. A guy just assumes because he is trying some things he's not familiar with, that the problem must be there. A path error!
So, you're right, putting the handler down in my /ROUTINES directory was just dumb.
I _was_ under the impression that I could include as many .py's as I wished when calling GladeVCP with -u, but evidently not. hitcounter.py was just leftover cruft from the sim.axis demo so I wasn't using it, but it definitely prevented things from loading when I tried to include both hitcounter and DemoHandler. I guess it won't matter once I move on to the class-based handler model.
Well. Good to know the example is once again thoroughly tested
Thanks tons Chris,
Ron
So, you're right, putting the handler down in my /ROUTINES directory was just dumb.
I _was_ under the impression that I could include as many .py's as I wished when calling GladeVCP with -u, but evidently not. hitcounter.py was just leftover cruft from the sim.axis demo so I wasn't using it, but it definitely prevented things from loading when I tried to include both hitcounter and DemoHandler. I guess it won't matter once I move on to the class-based handler model.
Well. Good to know the example is once again thoroughly tested
Thanks tons Chris,
Ron
Please Log in or Create an account to join the conversation.
Moderators: HansU
Time to create page: 0.222 seconds