How can we get the variation in decimal points? For example, if we are having a scale from 0 to 4, whenever we move the slider through the cursor, we get the value by 0, 1, 2, 3, 4. But, if we want the value in decimal points (with a variation of 0.1) like 0.1, 0.2, 0.3, 0.4........3.8, 3.9, 4.0. Then what do we have to do?
Use these opitons from_=0, to=4,resolution=0.1 Full code is here my_scale = tk.Scale(my_w, from_=0, to=4,resolution=0.1, orient='horizontal') my_scale.grid(row=2,column=1)
Using config option you can manage the height and width attributes, here connect the attributes to slider value. On change of slider the width or height will change. You can get the idea from here. www.plus2net.com/python/tkinter-canvas-arc.php If you are using a button as rectangle then config option can be used to manage the width of the button. Let us know if it worked for you or need one demo script.
How can we get the variation in decimal points?
For example, if we are having a scale from 0 to 4, whenever we move the slider through the cursor, we get the value by 0, 1, 2, 3, 4. But, if we want the value in decimal points (with a variation of 0.1) like 0.1, 0.2, 0.3, 0.4........3.8, 3.9, 4.0. Then what do we have to do?
Use these opitons
from_=0, to=4,resolution=0.1
Full code is here
my_scale = tk.Scale(my_w, from_=0, to=4,resolution=0.1, orient='horizontal')
my_scale.grid(row=2,column=1)
@@plus2net1 thank you 🙏
if I use one slider and one rectangle , and i want to change the shape of rectangle according to the slider value , then how we can do?
Using config option you can manage the height and width attributes, here connect the attributes to slider value. On change of slider the width or height will change. You can get the idea from here.
www.plus2net.com/python/tkinter-canvas-arc.php
If you are using a button as rectangle then config option can be used to manage the width of the button.
Let us know if it worked for you or need one demo script.