Skip to main content

A collection of custom tkinter bits

Project description

Tk-steroids

Tk-steroids contains custom, commonly reoccuring GUI elements (tkinter widgets).

Installing

pip install tk-steroids

Usage

from tk_steroids.MODULE import WIDGET
  • elements
    • Listbox
    • TickboxFrame
    • SliderFrame
    • DropdownList
    • Tabs
    • ButtonsFrame
  • matplotlib
    • CanvasPlotter
    • SequenceImshow
  • dialogs
    • TickSelect
  • menumaker
    • MenuMaker
  • settings
    • SettingsManager

Most widgets inherit from tk.Frame and use grid positioning system internally. There are exceptions such as MenuMaker that turns an inheriting class into a menu.

Example 1

The following example adds TickboxFrame on the second Tab page

import tkinter as tk
from tk_steroids.elements import Tabs, TickboxFrame

root = tk.Tk()

my_tabs = Tabs(root, ['Page 1', 'Page 2', 'Page 3'])
my_tabs.grid()

boxes = TickboxFrame(my_tabs.tabs[1], ['a', 'b', "c"], ['Fancyname A', 'Fabolous B', 'Handsome C'])
boxes.grid()

root.mainloop()

Example 2

This example shows how CanvasPlotter simplifies the matplotlib in Tk routine

import tkinter as tk
from tk_steroids.matplotlib import CanvasPlotter

root = tk.Tk()

plotter = CanvasPlotter(root)
plotter.grid()

# These are normal matplotlib figure and ax, also available
# - plotter.figure
# - plotter.ax
fig, ax = plotter.get_figax()

ax.plot([0,4,2])

# Calls FigureCanvasTkAgg draw-method
plotter.update()

root.mainloop()

For convinience, CanvasPlotter has also its own plot and imshow wrapper methods for quick plotting.

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

tk_steroids-0.8.1.tar.gz (36.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tk_steroids-0.8.1-py3-none-any.whl (36.7 kB view details)

Uploaded Python 3

File details

Details for the file tk_steroids-0.8.1.tar.gz.

File metadata

  • Download URL: tk_steroids-0.8.1.tar.gz
  • Upload date:
  • Size: 36.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for tk_steroids-0.8.1.tar.gz
Algorithm Hash digest
SHA256 e0e283f9d6b365b4e0bf1089c6805b5d809127544fc7da0acf08297cae695063
MD5 15085dbee3aed71e34c8edc5c05946f8
BLAKE2b-256 bbf4bac4a815d6f02427ba0a97b38599d82cc9f2c6fd0e289ec70d0f918df9e5

See more details on using hashes here.

File details

Details for the file tk_steroids-0.8.1-py3-none-any.whl.

File metadata

  • Download URL: tk_steroids-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 36.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for tk_steroids-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 da6e7c71a5ae3004cd1b2b5adb0667e341cc81eb159b66b938f9fc411c1d5a1e
MD5 83372f40ae3ec32d1c1b724eff84fed5
BLAKE2b-256 6d5af4b57c3c1e97b3da1e46442c1ab4e9281729371df09dde0cd5361f487905

See more details on using hashes here.

Supported by

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