Skip to main content

A package for TKinter and CustomTKinter

Project description

A simple package for adding different scenes to TKinter and CustomTKinter

You can view the source code on the Main Page

[!WARNING]
This project is in very early development.
Proceed with caution!

Setup

Run pip install tkscene in the terminal to download the package

Create a scene

To create a scene, use tkscene.Scene()

Adding child to a scene

Setting pack, grid and place

Use child.set_mode()

Loading and unloading scenes

scene.load()
scene.unload()

Reload scene

scene.reload()

Example:

# import modules
import tkinter as tk
import tkscenes

# make window
root = tk.Tk()
root.geometry("850x450")
root.title("Window")


# commands
def load_scene1() -> None:
    scene2.unload()
    scene1.load()


def load_scene2() -> None:
    scene1.unload()
    scene2.load()


# create scene
scene1 = tkscenes.Scene()
scene1["label"] = tk.Label(root, text="Scene1")
scene1["button"] = tk.Button(
    root, text="Next", command=load_scene2
)

scene2 = tkscenes.Scene()
scene2["label"] = tk.Label(root, text="Scene2")
scene2["button"] = tk.Button(
    root, text="Back",
    command=load_scene1
)

# define packing
scene1["label"].set_mode(
    "pack",
    fill="x"
)
scene1["button"].set_mode(
    "pack",
    anchor="center",
    expand=True
)

scene2["label"].set_mode(
    "pack",
    fill="x"
)
scene2["button"].set_mode(
    "pack",
    anchor="center",
    expand=True
)

# load scene 1
scene1.load()

# mainloop
root.mainloop()

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

tkscenes-0.1.1.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

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

tkscenes-0.1.1-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file tkscenes-0.1.1.tar.gz.

File metadata

  • Download URL: tkscenes-0.1.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.6

File hashes

Hashes for tkscenes-0.1.1.tar.gz
Algorithm Hash digest
SHA256 17343de137c0884b83737ae4af059f0a95344df52e0828417a82661fa5dc0a80
MD5 90f2c89e63722e30ecded4e8de2a59d9
BLAKE2b-256 56af4575d3e1e0c1a25f7f564e3db06251aa38f3144d6ec7438272a2c9e7296d

See more details on using hashes here.

File details

Details for the file tkscenes-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tkscenes-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.6

File hashes

Hashes for tkscenes-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 12bbd0dee2713b58bfd9abac4a57ad73f344f9fcfe79ec4c5f74b0569d6ac187
MD5 2f0feff118dd8774e2fe8ba46f65f44b
BLAKE2b-256 a3983ed22f237095c32726de4c50a4c9b86a190e0635df8bb8d0bc8ec3a2cd1f

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