tkinter-scale

Python Tkinter slider customization

最后都变了- 提交于 2020-05-26 10:20:26
问题 I'm new with tkinter, and I want to create a slider like the one in this picture: But I have no idea if this is even possible, so my question is: Is this possible, and does someone has a quick tutorial or something for me? 回答1: This can be done by customizing a ttk theme. The idea is to use images for the scale's trough (a vertical line) and slider (a circle). Theme elements can be created from these images using: style.element_create('custom.Vertical.Scale.trough', 'image', img_trough) style

How to create an “array” of multiple tkinter Scale widgets with Python?

喜你入骨 提交于 2020-01-24 20:31:07
问题 I am trying to create a GUI using Python 3.2.3 and the tkinter module. I need an "array" of Scale widgets but cannot for the life of me figure out how to return the values except by creating the Scale widgets one at a time and having a separate function for each one called by its command keyword argument passing the var . I can loop the widget creation bit and increment the row and column parameters as necessary but can't figure out how to retrieve the values of the Scale widgets. In "Basic"

How can I set the default value of my tkinter Scale widget slider to 100?

限于喜欢 提交于 2020-01-11 05:05:08
问题 How can I set the default value of my slider to 100 ? self.slider = tk.Scale(self.leftFrame, from_=0, to=256, orient=tk.HORIZONTAL, command=updateValue) 回答1: cursor=100 ? If that doesn't work, you can always manually self.slider.set(100) . 来源: https://stackoverflow.com/questions/3963329/how-can-i-set-the-default-value-of-my-tkinter-scale-widget-slider-to-100

How to use tkinter slider `Scale` widget with discrete steps?

爱⌒轻易说出口 提交于 2019-12-19 20:00:13
问题 Is it possible to have a slider ( Scale widget in tkinter) where the possible values that are displayed when manipulating the slider are discrete values read from a list? The values in my list are not in even steps and are situation dependent. From all the examples I've seen, you can specify a minimum value, a maximum value and a step value (n values at a time), but my list might look like this: list=['0', '2000', '6400', '9200', '12100', '15060', '15080'] Just as an example. To reiterate, I

How to retrieve the integer value of tkinter ttk Scale widget in Python?

被刻印的时光 ゝ 提交于 2019-12-08 02:39:46
问题 Could anyone advise how to retrieve and update a Label widget with the value from a Scale widget in Python? Currently it shows a very large real number. I have tried to type cast the value but this only works when I print to idle. I tried slider.get() but the label is blank. Also tried int(slider.get()) which works when I print to idle. from tkinter import * from tkinter import ttk root = Tk() root.title("Playing with Scales") mainframe = ttk.Frame(root, padding="24 24 24 24") mainframe.grid

How to retrieve the integer value of tkinter ttk Scale widget in Python?

拈花ヽ惹草 提交于 2019-12-06 06:19:34
Could anyone advise how to retrieve and update a Label widget with the value from a Scale widget in Python? Currently it shows a very large real number. I have tried to type cast the value but this only works when I print to idle. I tried slider.get() but the label is blank. Also tried int(slider.get()) which works when I print to idle. from tkinter import * from tkinter import ttk root = Tk() root.title("Playing with Scales") mainframe = ttk.Frame(root, padding="24 24 24 24") mainframe.grid(column=0, row=0, sticky=(N, W, E, S)) slider = IntVar() ttk.Scale(mainframe, from_=0, to_=100, length

How to use tkinter slider `Scale` widget with discrete steps?

こ雲淡風輕ζ 提交于 2019-12-01 19:58:53
Is it possible to have a slider ( Scale widget in tkinter) where the possible values that are displayed when manipulating the slider are discrete values read from a list? The values in my list are not in even steps and are situation dependent. From all the examples I've seen, you can specify a minimum value, a maximum value and a step value (n values at a time), but my list might look like this: list=['0', '2000', '6400', '9200', '12100', '15060', '15080'] Just as an example. To reiterate, I want it go from for instance list[0] to list[1] or list[6] to list[5] when pulling the slider. If