Skip to main content

A custom spinbox widget for customtkinter.

Project description

CTkSpinbox

Spinbox extension for customtkinter (add-on)

Installation

pip install CTkSpinbox

Usage

import customtkinter as ctk
from CTkSpinbox import *

def print_label(count):
  print(count)

window = ctk.CTk()
window.geometry('200x150')

spin_var = ctk.IntVar()
spinbox = CTkSpinbox(window,
          start_value = 10,
          min_value = 0,
          max_value = 20,
          scroll_value = 2,
          variable = spin_var,
          command = print_label)
spinbox.pack(expand = True)

window.mainloop()

Arguments

Parameter Description
master parent widget
width set width of the listbox
height set height of the listbox
start_value set starting value of the counter
min_value set the lowest value the counter can be set to
max_value set the highest value the counter can be set to
step_value set increment/decrement value of the buttons
scroll_value set increment/decrement value of the scroll wheel
variable setCTk/Tk variable to the counter
font set the font of the counter and buttons
fg_color set the foreground color of the spinbox frame
border_color set the border color of the spinbox frame
text_color set the text color of the the counter and buttons
button_color set the foreground color of the buttons
button_hover_color set the hover color of the buttons
border_width set the border width of the spinbox frame
corner_radius set the corner radius of the spinbox frame
button_corner_radius set the corner radius of the buttons
state set the state of the widget
command calls a command with counter value as a parameter when the counter is incremented/decremented

Methods

  • .decrement_counter() - decrements the counter value
  • .increment_counter() - increments the counter value
  • .scroll(scroll) - decrements/increments the counter value [use -1 to decrement and 1 to increment]
  • .get() - returns the counter value
  • .set(value) - sets the counter to a value
  • .disable() - disables the counter
  • .enable() - enables the counter
  • .bind(key, function, add) - executes the function when the event key is triggered
  • .update_counter() - updates counter variable and calls counter function.
  • .limit_counter() - restricts the value of the counter between the limits.
  • .configure(kwargs) - changes the parameters of the spinbox

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ctkspinbox-1.4.1.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

CTkSpinbox-1.4.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file ctkspinbox-1.4.1.tar.gz.

File metadata

  • Download URL: ctkspinbox-1.4.1.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.1

File hashes

Hashes for ctkspinbox-1.4.1.tar.gz
Algorithm Hash digest
SHA256 2b80c167995a9fb8e8c41196bf0df49662099b73873c31e66e5d4bf6f00bd37a
MD5 6374abf7536efa59a08cfe3e063f7f1e
BLAKE2b-256 bfe4b91b6fdf6b946c18dc751819227da993d3e8560262f9526e53b7b7ab83a2

See more details on using hashes here.

File details

Details for the file CTkSpinbox-1.4.1-py3-none-any.whl.

File metadata

  • Download URL: CTkSpinbox-1.4.1-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.1

File hashes

Hashes for CTkSpinbox-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7beca2fecba1645fd487f2462822e5635bec94565bcb711ad5821a5f782517e7
MD5 4d381849d75d9748fe9ae2a2701acb67
BLAKE2b-256 8c2b1598f3687f760b04f23c3bc113ea2af5984848677b5f9d96d2fc9ef2e5df

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page