A custom dialog component for CustomTkinter
Project description
๐ CustomCTkDialog
Beautiful dialogs, alerts, and native file pickers for CustomTkinter โ powered by a lightweight Electron executable.
โจ Features
โ๏ธ Modern dialogs that blend perfectly with CustomTkinter
โ๏ธ Custom alert boxes with multiple alert types
โ๏ธ Native-feeling folder picker powered by a lightweight Electron executable
โ๏ธ Plug-and-play โ no configuration required
โ๏ธ Clean, Pythonic API
โ๏ธ Automatic runtime download โ no large .exe included in the package
๐ Installation
pip install customctkdialog
๐ฆ Project Structure
CustomCTkDialog/
โ
โโโ CustomCTkDialog/ # Python package
โ โโโ __init__.py
โ โโโ electron_loader.py # Downloads Electron runtime on import
โ โโโ dialog_main.py # Main dialog system
โ
โโโ js-folder-picker/ # JS workspace (developers only)
โ โโโ folder-picker.js
โ โโโ package.json
โ โโโ build scripts
โ
โโโ example/
โ โโโ app.py # Example usage
โ
โโโ images/ # UI preview images
โ โโโ prompt.png
โ โโโ confirm.png
โ โโโ alert.png
โ
โโโ README.md
โโโ pyproject.toml
๐ Note:
The js-folder-picker/ folder is not included in the published Python package.
๐ Runtime Logic with electron_loader
Previously, the Python package included a large bundled .exe, which made installation heavy and slow.
CustomCTkDialog now uses a dynamic runtime loader:
- On package import,
electron_loader.ensure_electron()runs automatically. - It checks whether the Electron folder picker runtime is already present.
- If missing, the user is prompted:
Some necessary files are required for CustomCTkDialog.folder_picker to work.
Download these files now? (Y/n):
- If the user agrees, the ZIP is downloaded from GitHub Releases.
- The ZIP is extracted into the package directory.
- Future imports detect the runtime and do not download again.
โ๏ธ Benefits
- Very lightweight PyPI package
- Automatic runtime management
- Easy to release updates via GitHub
๐งช Example Usage
Here are the UI components included in the package:
from CustomCTkDialog import Dialog, folder_picker, file_picker, AlertType
# Prompt input
try:
name = Dialog.prompt("Enter your name:", default_text="Alice")
print("Prompt returned:", name)
except ValueError as error:
print("Prompt canceled:", error)
# Confirm dialog
confirmed = Dialog.confirm("Do you want to continue?")
print("Confirm returned:", confirmed)
# Alert
Dialog.alert(AlertType.SUCCESS, "Test Alert", "This is a success alert!")
# File picker
files = file_picker(initialdir="D:/")
print("Selected files:", files)
# Folder picker (Electron runtime downloads automatically on first run)
directories = folder_picker(initialdir="D:/")
print("Selected folders:", directories)
๐งฐ API Reference
Dialog class
| Method | Description |
|---|---|
prompt() |
Shows an input dialog, returns string or raises ValueError. |
confirm() |
Shows a yes/no dialog, returns boolean. |
alert() |
Shows an alert with the specified AlertType. |
folder_picker()
paths = folder_picker()
file_picker()
files = file_picker()
๐ Development
Install dependencies
pip install -r requirements.txt
Run example
python example/app.py
Rebuild JS folder picker
cd js-folder-picker
npm install
npm run build
Upload the resulting ZIP to GitHub Releases.
๐ฆ Build & Publish (maintainers only)
Build
python -m build --no-isolation
Upload to TestPyPI
python -m twine upload --verbose --repository testpypi dist/*
๐ TestPyPI & PyPI Upload Permissions
To protect users and maintain high-quality releases, upload permissions for both TestPyPI and PyPI are limited to the project owner and approved maintainers.
This ensures:
- Secure, trusted releases
- Proper version control
- A consistent publishing workflow
Want to become a maintainer?
- Open an issue on GitHub expressing your interest.
- Contact the project owner.
- Once approved, your account will be added under Settings โ Collaborators, enabling you to publish updates.
Your contributions are valued โ thank you for helping improve the project!
๐ค Contributing
- Pull requests welcome!
- JS improvements must be rebuilt before packaging.
- Release updates through GitHub to support the runtime downloader.
๐ License
Creative Commons AttributionโNonCommercial 4.0 (CC BY-NC 4.0)
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 customctkdialog-0.2.5.tar.gz.
File metadata
- Download URL: customctkdialog-0.2.5.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c99eebfa8b3df812e25c20cfe256505d443207702ba95cc31024d79d15c0e024
|
|
| MD5 |
c12544bf5ffce40c3673400079d205ed
|
|
| BLAKE2b-256 |
f8c78f86ab62f3efd416ab988725e50aa5b5299cc66d01ac83ec54307c865c4d
|
File details
Details for the file customctkdialog-0.2.5-py3-none-any.whl.
File metadata
- Download URL: customctkdialog-0.2.5-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d673cb08a40f3ad040c635a46440aede9ff787c25825a9cddfe6ea999bb8d166
|
|
| MD5 |
4f881f606979c815072386c80bb82867
|
|
| BLAKE2b-256 |
dcc90260d252c83236ed7cfca48b545a6b7fb29fafa6dc75d6108ef3f84ab8af
|