Gscreen - Glade Slider - Need Help
- Ivan_The_Red
- Offline
- Premium Member
-
Less
More
- Posts: 92
- Thank you received: 2
29 Dec 2016 18:06 #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 or Create an account to join the conversation.
30 Dec 2016 01:43 - 30 Dec 2016 01:50 #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:
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.
Please Log in or Create an account to join the conversation.
30 Dec 2016 01:52 #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 or Create an account to join the conversation.
- Ivan_The_Red
- Offline
- Premium Member
-
Less
More
- Posts: 92
- Thank you received: 2
30 Dec 2016 02:41 #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 or Create an account to join the conversation.
Moderators: HansU
Time to create page: 0.156 seconds