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.0.tar.gz (35.8 kB view details)

Uploaded Source

Built Distribution

tk_steroids-0.8.0-py3-none-any.whl (36.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tk_steroids-0.8.0.tar.gz
  • Upload date:
  • Size: 35.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for tk_steroids-0.8.0.tar.gz
Algorithm Hash digest
SHA256 c27b72dd1998289236aa0711b88b8f9f602165b815919c4d775c265f79e58fb3
MD5 c814f6128239ec1a8e183a6acb8724ad
BLAKE2b-256 e3eb1274d652044056a6caa2824070414e00af89c067bb654bc33e1befd1de75

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tk_steroids-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 36.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for tk_steroids-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9629a965b17828810f129ed32701b5f7e8a47d8eb63bb9ee99bb76c5f68dc4a
MD5 c3a5c612b5004a293b16e6c32cedec75
BLAKE2b-256 269d512290b5283ed4ab3bee8be746f142c97982f547506e925ec6c80b474c7a

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