Skip to main content

A small package for easily using Tkinter.

Project description

Downloads

Documentation ManagerTk

ManagerTk - is a library that aims to make writing code using Tkinter simple and fast.

Download Package

pip install ManagerTk

Functions:

coord_view(window, mode_bool) - Creates an empty duplicate of the window in which it tracks the mouse coordinates in the window.

create_mpage(window, ui_page, size) - Creates a window with the specified parameters and interface.

redirect_pages(page_ui_1, page_ui_2, side=None) - Sends from one page of the program to another.

add_url_image(window, url, size) - Adds a picture from the url address as an object with a specified size (optional, you can omit it).

window_exit(title: str, message: str) - Displays the screen with the specified text and exits the program if the question is answered positively.

documentation() - Displays a link to the module documentation.

Example:

import tkinter
import ManagerTk

window = tkinter.Tk()
window.title("Example")
count = 0


def counter_click():
    global count
    count += 1
    counter_label["text"] = f"Count clicks: {count}."


label_1_page = tkinter.Label(text="First Page Title")
label_2_page = tkinter.Label(text="Second Page Title")
label_1_in_1_page = tkinter.Label(text="Default text in page 1")
label_1_in_2_page = tkinter.Label(text="Default text in page 2")
button_1_in_2_page = tkinter.Button(text="Default button with function in page 2", command=counter_click)
counter_label = tkinter.Label(text=f"Count clicks: {count}.")
icon = ManagerTk.add_url_image(window, "https://i.ibb.co/p0yMNc0/DK404-icon.png", (80, 80))

button_1t2 = tkinter.Button(text="Redirect to second page.",
                            command=lambda: ManagerTk.redirect_pages(page_1, page_2))

button_2t1 = tkinter.Button(text="Redirect to first page",
                            command=lambda: ManagerTk.redirect_pages(page_2, page_1))

page_1 = [
    [label_1_page, [150, 20]],
    [label_1_in_1_page, [20, 60]],
    [icon, [320, 40]],
    [button_1t2, [20, 150]]
]

page_2 = [
    [label_2_page, [150, 20]],
    [label_1_in_2_page, [20, 60]],
    [button_1_in_2_page, [160, 80]],
    [counter_label, [20, 80]],
    [button_2t1, [20, 150]]
]

ManagerTk.create_mpage(window, page_1, "400x200")

window.mainloop()
This example creates a simple application with two functional pages that can be switched using buttons.

Contacts

Telegram - @DK50503
Discord - DK404#4089

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

ManagerTk-0.1.post2.tar.gz (4.6 kB view hashes)

Uploaded Source

Built Distribution

ManagerTk-0.1.post2-py3-none-any.whl (4.9 kB view hashes)

Uploaded Python 3

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