-5

I'm trying to make a vertical slider with the Scale widget that has words as the intervals. For example, a slider that has

  • "maximum"
  • "median"
  • and "minimum"

in text as the intervals. Is it possible?

finefoot
  • 9,914
  • 7
  • 59
  • 102
katie
  • 21
  • 1
  • 2
    Welcome to StackOverflow. Please read and follow the posting guidelines in the help documentation, as suggested when you created this account. [On topic](http://stackoverflow.com/help/on-topic), [how to ask](http://stackoverflow.com/help/how-to-ask), and [... the perfect question](https://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/) apply here. StackOverflow is not a design, coding, research, or tutorial resource. However, if you follow whatever resources you find on line, make an honest coding attempt, and run into a problem, you'd have a good example to post. – Prune Nov 29 '18 at 20:11

1 Answers1

0

Depending on what you want to do with your slider, you can use label from tk.Scale:

enter image description here enter image description here enter image description here

import tkinter as tk

SCALE_LABELS = {
    0: "minimum",
    1: "median",
    2: "maximum"
}

def scale_labels(value):
    scale.config(label=SCALE_LABELS[int(value)])

root = tk.Tk()

scale = tk.Scale(root, from_=min(SCALE_LABELS), to=max(SCALE_LABELS),
    orient=tk.HORIZONTAL, showvalue=False, command=scale_labels)

scale.pack()
root.mainloop()
finefoot
  • 9,914
  • 7
  • 59
  • 102