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
Loading and unloading scenes
scene.load()
scene.unload()
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tkscenes-0.0.8.tar.gz.
File metadata
- Download URL: tkscenes-0.0.8.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6745c1cccc89d60b1b1701e5e4e2172205b45854638874347400a21c9f87068b
|
|
| MD5 |
a38b28556e38c42dd7aecefbc8499dec
|
|
| BLAKE2b-256 |
25a4fe335ac4801f4a0e9afafef055eddeedf334fd6ebae85e5f959850aeab7a
|
File details
Details for the file tkscenes-0.0.8-py3-none-any.whl.
File metadata
- Download URL: tkscenes-0.0.8-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebd8ca5a0d704a5c6b26d8dce9b653601647df8360e2d0920613cf2b547dfd83
|
|
| MD5 |
6c725d38155269084aba3190485301f5
|
|
| BLAKE2b-256 |
923eebedf48298c9b09d006f3adf85bd130b2bcf23494dc505315c56502a1d8d
|