- Posts: 83
- Thank you received: 0
Gscreen - Glade Slider - Need Help
- Ivan_The_Red
- Topic Author
- Offline
- Premium Member
-
Less
More
9 years 10 months ago #84863
by Ivan_The_Red
Gscreen - Glade Slider - Need Help was created 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
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.
9 years 10 months ago #84889
by cmorley
Replied by cmorley on topic Gscreen - Glade Slider - Need Help
I would use keybindings to run the slider:
add this to your handler file:
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
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.
9 years 10 months ago #84890
by cmorley
Replied by cmorley on 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
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.
- Ivan_The_Red
- Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 83
- Thank you received: 0
9 years 10 months ago #84892
by Ivan_The_Red
Replied by Ivan_The_Red on 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
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
