Giter VIP home page Giter VIP logo

ctkrangeslider's Introduction

CTkRangeSlider

A range slider widget made for customtkinter

Screenshot

Installation

GitHub repo size

Download the source code, paste the CTkRangeSlider folder in the directory where your program is present.

Example

from CTkRangeSlider import *
import customtkinter

def show_value(value):
    print(value)
    
root = customtkinter.CTk()

range_slider = CTkRangeSlider(root, command=show_value)
range_slider.pack(padx=30, pady=30, fill="both")

root.mainloop()

Arguments

Parameters Details
master root window, can be tkinter.Frame or CTkFrame
command callback function, receives slider value as argument, two separate commands can be given by command=(cmd1, cmd2)
variables tuple: set two tkinter.IntVar or tkinter.DoubleVar objects
width slider width in px
height slider height in px
corner_radius corner roundness of the slider
border_width space around the slider rail in px
from_ lower slider value
to upper slider value
number_of_steps number of steps in which the sliders can be positioned
fg_color foreground color, tuple: (light_color, dark_color) or single color
progress_color tuple: (light_color, dark_color) or single color or "transparent", color of the slider line before the button
border_color slider border color, tuple: (light_color, dark_color) or single color or "transparent", default is "transparent"
button_color color of the slider buttons, tuple: (light_color, dark_color) or single color or ((light_color_1, dark_color_1), (light_color_2, light_color_2)) for separate button colors
button_hover_color hover color, tuple: (light_color, dark_color) or single color
button_width width of the buttons in px
button_length length of the buttons in px
button_corner_radius corner roundness of the buttons
orientation "horizontal" (standard) or "vertical"
state "normal" or "disabled" (not clickable)
hover bool, enable/disable hover effect, default is True

Methods:

  • .configure(attribute=value, ...)

    All attributes can be configured and updated.

     range_slider.configure(fg_color=..., progress_color=..., button_color=..., ...)
  • .set([value, value])

    Set sliders to specific float value.

  • .get()

    Get current values of slider.

  • .cget("attribute_name")

    Get any attribute value.

More Details

This widget works just like the normal customtkinter slider widget, but it has dual slider-heads instead of one. A special thanks to EN20M for providing the custom DrawEngine for rangeslider. Follow me for more stuff like this: Akascape

That's all, hope it will help!

ctkrangeslider's People

Contributors

akascape avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.