A comprehensive multilingual GUI extension library for Tkinter with enhanced message boxes, and Windows-specific features
Project description
Tkface
Restore the "face" to your Tkinter!
A multilingual GUI extension library for Tkinter (tkinter) - bringing back the "face" (interface) that Tkinter left behind.
📖 Overview
Tkface is a Python library designed to restore and enhance the "face" (user interface) of Tkinter. While Tkinter is a powerful toolkit, its dialogs and user-facing components are minimal and lack friendly interfaces. Tkface fills this gap with multilingual dialogs, advanced message boxes, and Windows-specific features.
- Completing the Interface: Tkinter stands for "Tk interface," providing a powerful core for building GUIs. Tkface is designed to complement it by providing the user-facing components—the "face"—that are essential for a polished user experience but not built into the standard library. It extends Tkinter with ready-to-use, multilingual dialogs and widgets, letting you build sophisticated, user-friendly applications with less effort.
- Vibe Coding: Developed with a "Vibe Coding" approach-prioritizing developer joy, rapid prototyping, and a sense of fun. The codebase is hackable, readable, and easy to extend—and so is this document.
🔧 Requirements
- Python 3.7+
- Tkinter (included with Python)
- No additional dependencies
📦 Installation
Install the latest version from PyPI:
pip install tkface
Or install from the GitHub repository for the latest changes:
pip install git+https://github.com/mashu3/tkface.git
🚀 Usage
Message Boxes
from tkface import messagebox
# Simple information dialog
messagebox.showinfo("Success", "Operation completed successfully!")
# Multilingual support
messagebox.showerror("Error", "An error has occurred!", language="ja")
# With system sound (Windows only)
messagebox.showerror("Error", "An error has occurred!", bell=True)
# Confirmation dialog
if messagebox.askyesno("Confirm", "Do you want to save?"):
save_file()
Screenshots
| Dialog Type | Windows Environment |
|---|---|
| Warning | |
| Error | |
| Information | |
| Question |
Input Dialogs
from tkface import simpledialog
# String input
name = simpledialog.askstring("Name", "Enter your name:")
# Integer input with validation
age = simpledialog.askinteger("Age", "Enter your age:", minvalue=0, maxvalue=120)
# List selection dialog
color = simpledialog.askfromlistbox("Choose a color:", choices=["Red", "Green", "Blue"])
# Multiple selection dialog
colors = simpledialog.askfromlistbox("Choose colors:", choices=["Red", "Green", "Blue"], multiple=True)
Windows-Specific Features
import tkinter as tk
import tkface
root = tk.Tk()
tkface.win.dpi() # Enable DPI awareness (Windows only)
tkface.win.unround(root) # Disable corner rounding (Windows 11 only)
tkface.win.bell("error") # Play Windows system sound (Windows only)
# Windows-specific flat button styling
button = tkface.Button(root, text="Flat Button", command=callback) # No shadow on Windows
root.mainloop()
Note: All Windows-specific features gracefully degrade on non-Windows platforms.
Language Management
from tkface import lang
import tkinter as tk
root = tk.Tk()
lang.set("ja", root) # Set language manually
lang.set("auto", root) # Auto-detect system language
# Register custom translations
custom_translations = {
"ja": {
"Custom Message": "カスタムメッセージ",
"Custom Button": "カスタムボタン"
}
}
from tkface import simpledialog
simpledialog.askfromlistbox(
"Choose an option:",
choices=["Option 1", "Option 2", "Option 3"],
custom_translations=custom_translations,
language="ja"
)
🧩 Features
- Multilingual Support: Automatic language detection, English/Japanese built-in, custom dictionaries
- Enhanced Message Boxes: All standard and advanced dialogs, custom positioning, keyboard shortcuts, tab navigation
- Enhanced Input Dialogs: String/integer/float input, validation, password input, list selection, custom positioning
- Windows Features: DPI awareness, Windows 11 corner rounding control, Windows system sounds, flat button styling (gracefully degrade on other OS)
📁 Examples
See the examples/ directory for complete working examples:
demo_messagebox.py- Message box demonstrationsdemo_simpledialog.py- Input dialog demonstrations
Note: Test files are not included in the public release. For testing, see the development repository.
🌐 Supported Languages
- English (en): Default, comprehensive translations
- Japanese (ja): Complete Japanese translations
You can add support for any language by providing translation dictionaries:
custom_translations = {
"fr": {
"ok": "OK",
"cancel": "Annuler",
"yes": "Oui",
"no": "Non",
"Error": "Erreur",
"Warning": "Avertissement"
}
}
📝 License
This project is licensed under the MIT License. See the LICENSE file for details.
👨💻 Author
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 tkface-0.0.4.tar.gz.
File metadata
- Download URL: tkface-0.0.4.tar.gz
- Upload date:
- Size: 22.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f03eb57995bf658d3af544a9380067a38ede94536d4070862715e5c8f5ea03c
|
|
| MD5 |
6ff45555a6d5726b10693b670458e883
|
|
| BLAKE2b-256 |
95018d4ca60f518009691916c0f281769a37ca2b6578bc0c27a9928ce5cad0bb
|
File details
Details for the file tkface-0.0.4-py3-none-any.whl.
File metadata
- Download URL: tkface-0.0.4-py3-none-any.whl
- Upload date:
- Size: 22.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e27e3c2103243089c45ac16743854b1bc9edfea6df3ed921d10946228efb4f5a
|
|
| MD5 |
5848ebabb9bf61ad4118cf264560658c
|
|
| BLAKE2b-256 |
88a9c7bd5ddf94acdd9694b994767568f3ac48065a345327c96bafa65b73c0b2
|