Code Monkey home page Code Monkey logo

tk-steroids's Introduction

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.

tk-steroids's People

Contributors

jkemppainen avatar

Stargazers

 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.