Tkinter Scale to set and get value by moving slider with orient & other options and methods

Поделиться
HTML-код
  • Опубликовано: 4 янв 2025

Комментарии •

  • @gauravverma365
    @gauravverma365 Год назад

    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?

    • @plus2net1
      @plus2net1  Год назад

      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)

    • @gauravverma365
      @gauravverma365 Год назад

      @@plus2net1 thank you 🙏

  • @sharvariwalde8116
    @sharvariwalde8116 2 года назад

    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?

    • @plus2net1
      @plus2net1  2 года назад

      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.