Overview of TkEasyGUI
maintkinter. It is designed to provide an easy-to-use interface for creating graphical user applications.repository·main·Indexed 43 days ago
https://github.com/kujirahand/tkeasygui-pythonA lightweight, easy-to-use GUI library for Python 3 built on top of Tkinter. It provides a simplified API for windows, widgets, and dialogs, and is designed to be compatible with the event-driven model of PySimpleGUI. Version 1.0.45 includes modules for dialogs, widgets, and utilities, supporting both modern ttk and classic tk rendering styles.
tkinter. It is designed to provide an easy-to-use interface for creating graphical user applications.TkEasyGUI.locale_easy module provides functions to manage application localization (i18n). It allows you to get and set the current locale, as well as retrieve and define localized text strings using keys.TkEasyGUI is organized into several functional modules that allow you to build GUI applications using popups, standard widgets, and utilities:
popup, popup_get_file).Window, Button, Input, Text).get_clipboard and set_clipboard.The Push element is used to achieve right alignment or center alignment within a layout by acting as a flexible spacer.
sg.Push() before the element.sg.Push() both before and after the element.win = sg.Window(
title="Hello World",
layout=[
[sg.Text("=" * 50)],
[sg.Push(), sg.Button("Hello World")], # right alignment
[sg.Push(), sg.Button("OK"), sg.Push()], # center alignment
]
)
while win.is_running():
event, values = win.read()TkEasyGUI is designed to be compatible with the event-driven model of PySimpleGUI.
window.read()) are compatible.Both VPush and VSeparator share a standard set of methods for interaction and lifecycle management:
bind(event_name, handle_name, propagate=True, event_mode='user'): Binds a specific event to a handler.bind_events(events: dict[str, str], event_mode='user'): Binds multiple user events. If an event key has the suffix /hide, it will not be returned to the user via window.read().update(**kw): Updates the widget configuration.focus() / focus_set(): Sets focus to the element.get(): Retrieves the current value of the widget.set_disabled(disabled: bool): Enables or disables the widget.get_height() / get_width(): Returns the current dimensions of the element.get_name(): Returns the element's key.TkEasyGUI is inspired by PySimpleGUI and is designed to be compatible with its event model and basic GUI component names.
Key points:
TkEasyGUI is designed to be intuitive for users familiar with PySimpleGUI.
Compatibility:
PySimpleGUI.Differences:
PySimpleGUI.window.event_iter() for cleaner event loops, specialized popups (eg.popup_buttons, eg.popup_color, eg.popup_get_form), and enhanced Image support (JPEG in addition to PNG).You can use bind_events to map specific user actions to event keys. This is useful for reacting to changes in the file selection process.
Note on /hide suffix: If you attach the suffix /hide to an event key in your mapping, that specific event key will be suppressed and will not be returned to the user during window.read() calls.
# Example concept of binding events
# widget.bind_events({"event_key": "handler_name"})TkEasyGUI is designed to be compatible with the PySimpleGUI event model, making it easy for developers to switch.
Key similarities and differences:
event, values = window.read()).window.event_iter(), custom popups (eg.popup_color), and support for JPEG in the Image class.TkEasyGUI is organized into several submodules that handle specific GUI functionalities:
TkEasyGUI.dialogs: For creating popup dialogs (e.g., text or input dialogs).TkEasyGUI.widgets: Core UI components.TkEasyGUI.widgets_image: Image-based widgets.TkEasyGUI.widgets_window: Window-related widget management.TkEasyGUI.locale_easy: Localization and easy language handling.TkEasyGUI.utils: Utility functions.TkEasyGUI.version: Version information.You can install TkEasyGUI via PyPI or directly from the GitHub repository.
Requirements:
Tkinter is available).Note for Raspberry Pi users:
Pillow instead of PIL: pip install --upgrade --force-reinstall pillow.python3-tk is installed: sudo apt-get install python3-tk.# From PyPI
python -m pip install TkEasyGUI
# From GitHub
python -m pip install git+https://github.com/kujirahand/tkeasygui-python