Gscreen - Glade Slider - Need Help

More
29 Dec 2016 18:06 #84863 by Ivan_The_Red
Ivan_The_Red created the topic: Gscreen - Glade Slider - Need Help
Hello,

Ive been working with Gscreen and have added a horizontal slider to add the ability to change the jog feed rate but I cannot seem to figure out how to assign hotkeys to the slider. I'm using Glade to build the GUI and there are "accelerator keys" available but when I choose an accelerator key , save the Glade file and start Linuxcnc it doesn't work.......I'm baffled. I can assign accelerator keys successfully to buttons just fine.Does anybody know how sliders and accelerator keys are set up?

Thanks
Jeff
More
30 Dec 2016 01:43 - 30 Dec 2016 01:50 #84889 by cmorley
cmorley replied the topic: Gscreen - Glade Slider - Need Help
I would use keybindings to run the slider:

add this to your handler file:
def on_keycall_INCREMENTS(self,state,SHIFT,CNTRL,ALT):
            if SHIFT:
                print 'jog speed up'
            else:
                print 'jog speed down'

Now pressing i or shifted i will print the text in a terminal.
change the code to increase or decrease your slider.
something like:
curent = self.widgets.widgetname.get_value( )
self.widgets.widgetname.set_value(current+1 )

This is a built in keycall definition, other keys could be chosen.
There is a small example in the manual:
www.linuxcnc.org/docs/2.7/html/gui/gscre...tml#_adding_features
the example about halmeter launching with F4 shows shows how to add arbitrary keys with arbitrary function calls.

Chris M
Last Edit: 30 Dec 2016 01:50 by cmorley.
More
30 Dec 2016 01:52 #84890 by cmorley
cmorley replied the topic: Gscreen - Glade Slider - Need Help
Thinking about it - gscreen may already use i and I for jog increment changes.
add in the commands I posted would override this.
Just so you know what happened (if it matters to you).

Chris M
More
30 Dec 2016 02:41 #84892 by Ivan_The_Red
Ivan_The_Red replied the topic: Gscreen - Glade Slider - Need Help
Thanks Chris ,
I just got in from the shop and ill gibe the i and l keys a try tomorrow morning. I also found a way to do it by setting a jog increment then sending a jog-increment command but id like to be able to create hotkeys also.

Thanks
Jeff
Moderators: mhaberler
Time to create page: 0.069 seconds
Powered by Kunena Forum