Gscreen - Glade Slider - Need Help

More
9 years 10 months ago #84863 by Ivan_The_Red
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

Please Log in to join the conversation.

More
9 years 10 months ago #84889 by cmorley
I would use keybindings to run the slider:

add this to your handler file:
Code:
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

Please Log in to join the conversation.

More
9 years 10 months ago #84890 by cmorley
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

Please Log in to join the conversation.

More
9 years 10 months ago #84892 by Ivan_The_Red
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

Please Log in to join the conversation.

Time to create page: 0.074 seconds
Powered by Kunena Forum