Question regarding Python callbacks

More
25 Jan 2019 01:31 #124780 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.
  • 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
Attachments:

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

More
25 Jan 2019 01:43 #124782 by islander261
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

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

More
25 Jan 2019 03:59 #124790 by cmorley
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
The following user(s) said Thank You: dokwine

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

More
25 Jan 2019 05:45 #124793 by dokwine
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

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

Moderators: mhaberler
Time to create page: 0.092 seconds
Powered by Kunena Forum