PYVCP - SCALE Widget - Set Initial value

  • Askjerry
  • Askjerry's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
16 Aug 2015 13:25 - 16 Aug 2015 13:31 #61425 by Askjerry
I've created some really nice panels now... I usually include a SCALE widget to control the jog feed rate.

Typically this scale will go from 1 to 60... depending on the machine... and as such, will initially come up as 1. I always forget that... and click a jog button... then wonder why the machine "didn't move"... but it did... just VERY slowly. So I wanted it to start up faster than that.... a different initial value.

Here is the typical code I use...
<vbox>
<relief>RAISED</relief>
<bd>2</bd>
<label>
<text>"Jog Speed"</text>
<font>("Helvetica",10)</font>
</label>
<scale>
<font>("Helvetica",10)</font>
<halpin>"jog-speed"</halpin>
<orient>HORIZONTAL</orient>
<resolution>1</resolution>
<min_>1</min_>
<max_>60</max_>
</scale>
</vbox>

I wanted it to start off initially as 15 instead of 1... so I looked at the SPINBOX widget which has
<initval>15</initval>
So I decided to give it a try... the PYVCP document didn't say anything about it... but I figured it would probably work. ;)

It works!
(Just wanted to pass that info along to someone else who might need it.)

Here is the code I used if you want to tinker with it...
<vbox>
<relief>RAISED</relief>
<bd>2</bd>
<label>
<text>"Jog Speed"</text>
<font>("Helvetica",10)</font>
</label>
<scale>
<font>("Helvetica",10)</font>
<halpin>"jog-speed"</halpin>
<orient>HORIZONTAL</orient>
<resolution>1</resolution>
<initval>15</initval>
<min_>1</min_>
<max_>60</max_>
</scale>
</vbox>

Jerry B)
I added a new section to my web page for CNC stuff if you are interested... ASKJERRY.INFO
Last edit: 16 Aug 2015 13:31 by Askjerry. Reason: Clarity / Add Link

Please Log in or Create an account to join the conversation.

More
16 Aug 2015 19:00 #61431 by BigJohnT
Replied by BigJohnT on topic PYVCP - SCALE Widget - Set Initial value
I looked in the manual and initval is indeed in the scale description.

JT
The following user(s) said Thank You: Askjerry

Please Log in or Create an account to join the conversation.

  • Askjerry
  • Askjerry's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
16 Aug 2015 20:35 #61440 by Askjerry
Replied by Askjerry on topic PYVCP - SCALE Widget - Set Initial value
I just looked again... you are right... I must have missed it.
(2:00am programming caught up with me I guess.)

Thanks,
Jerry

Shall I delete this post?

Please Log in or Create an account to join the conversation.

More
16 Aug 2015 22:02 #61442 by BigJohnT
Replied by BigJohnT on topic PYVCP - SCALE Widget - Set Initial value
That's up to you, if you edit the original post to just explain what you did it would be informative to others that search the forum.

JT

Please Log in or Create an account to join the conversation.

  • Askjerry
  • Askjerry's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
16 Aug 2015 22:25 #61447 by Askjerry
Replied by Askjerry on topic PYVCP - SCALE Widget - Set Initial value
I'll leave it... you are correct... it could help another coffee deprived programmer...

Please Log in or Create an account to join the conversation.

Time to create page: 0.231 seconds
Powered by Kunena Forum