hal_spinbutton
i thought it was the Value field inside Adjustment Properties, but it doesn't work.
any suggestion?
thanks, Davide.
Please Log in or Create an account to join the conversation.
Hi, does anyone know if it's possible to set an initial value of a spinbutton?
i thought it was the Value field inside Adjustment Properties, but it doesn't work.
any suggestion?
thanks, Davide.
Let me google that for you: lmgtfy.com/?q=gtk+spinbutton+glade+no+default+value
See www.gtkforums.com/viewtopic.php?t=4355
This is due to the old Gtk version in 10.04. This means currently you'll have to hand-edit the gui file to fix this.
- Michael
Please Log in or Create an account to join the conversation.
i simply didn't think it was a bug. Please, don't think i'm just waitin' for help from here. It's two weeks that i'm studying and setting up this panel the best i can, all day long.
now... manually setting the .ui file as suggested in that thread works to set initial value, but the initial value that appear inside the spinbutton, isn't passed to its hal_pin.
my hal config looks like:
this hal is loaded into the main .ini file:...
net BX-mux-sel tgvcp.hal_button1 => mux2.1.sel
net BX-mux-in tgvcp.hal_spinbutton1-f => mux2.1.in1
net BX-mux-out mux2.1.out => mux2.1.in0 dab_tetrapodkins.Bx
...
then if i set the spinbutton initial value to 2000, as i start emc2, the spinbutton is set at 2000, but mux2.1.in1 is 0, and so dab_tetrapodkins.Bx.GLADEVCP = -c tgvcp -u tgvcp.py -H tgvcp.hal tgvcp.ui
tried also to set directly:
but it's the same.net BX-prova tgvcp.hal_spinbutton1-f dab_tetrapodkins.Bx
I also tried your method to record widget values, but i have the same problem: the widget start with the right value, but its hal pin don't.
any suggestion, please? (tried some googling, without any result).
Davide.
Please Log in or Create an account to join the conversation.
Define a signal handler for the realize (widget creation) event and set the value there like so:
def on_realize(self,widget):
widget.set_value(3.14)
Associate the GtkWidget 'realize' signal with this 'on_realize' handler in glade.
- Michael
Please Log in or Create an account to join the conversation.
i'm trying that right now.
Thanks, Davide.
Please Log in or Create an account to join the conversation.
and as the widget is drawn it assumes the value of 30, but unfortunately the hal_pin associated to that doesn't change.def on_hal_spinbutton1_realize(self,widget):
widget.set_value(30)
Please Log in or Create an account to join the conversation.
Hi, that's what i wrote:
and as the widget is drawn it assumes the value of 30, but unfortunately the hal_pin associated to that doesn't change.def on_hal_spinbutton1_realize(self,widget):
widget.set_value(30)
1. It does work for me, again I have no idea what version of emc you are running. I cannot help you with some random branch with hasnt been merged with recent fixes.
2. You can try to add
widget.hal_update()
and see wether that improves things.
If not, try with master or v2.5_branch. If this helps, merge your branch upwards.
- Michael
Please Log in or Create an account to join the conversation.
I cannot help you with some random branch with hasnt been merged with recent fixes.
I think Davide is on joints_axes3. It looks like that is merging to 2.4 not 2.5.
Please Log in or Create an account to join the conversation.
git.linuxcnc.org/gitweb?p=emc2.git;a=com...c785ac63d5eb22053496
any support for gladevcp is bound to be a hit and miss game
I suggest you talk to the author to merge it with master again
- Michael
Please Log in or Create an account to join the conversation.
it's almost 2 years i'm try to solve that bug, and only in last months i could with a great help from this forum and mailing list.
Now that i finally have the machine worknig, i want to add some functionality, as a good and useful glade panel. and i have it, but if something into this panel doesn't work it's not the case to restart changing the source of emc 2.5 to make manual jogging work!! I'm also a supporter of the logics under Joints_Axes branch, because i think that's the way it should be..
But, going back to this case: my setup is an inverted cable tetrapod, and i have 4 pin to set up the positions of the 4 pulleys (Bx,Cx,Cy and Dy) into my kinematic module.
since i'll have different places where to 'play' this machine, i wanted to use a .ini file to recall each place dimensions. to do that, first i have to make this thing work: setup a value of the spinbutton from outside (for example a set_value from the python file..) in a way that the hal_pin associated to that change as well.
I'm going to try also that. i tried before with widget.update, i didn't know of the existance of hal_update (even if i could imagine...)2. You can try to add
widget.hal_update()
Thanks to tell me this, it's important for me, so i know that maybe the different version could be the problem.1. It does work for me, again I have no idea what version of emc you are running. I cannot help you with some random branch with hasnt been merged with recent fixes.
i'm going on trying. Thanks, Davide.
Please Log in or Create an account to join the conversation.