Name | pygubu-designer JSON |
Version |
0.40.1
JSON |
| download |
home_page | None |
Summary | A simple GUI designer for the python tkinter module |
upload_time | 2025-01-25 20:07:45 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | GPL-3 |
keywords |
gui
tkinter
designer
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
[Leer en EspaƱol](Documentation/README/es.md). More translations [here](Documentation/README)
Welcome to Pygubu!
============================================
`Pygubu` is a [RAD tool](https://en.wikipedia.org/wiki/Rapid_application_development) to enable _quick_ and _easy development of user interfaces_ for the Python's `tkinter` module.
The user interfaces designed are saved as [XML](https://en.wikipedia.org/wiki/XML) files, and, by using the _pygubu builder_, these can be loaded by applications dynamically as needed.
Pygubu is inspired by [Glade](https://gitlab.gnome.org/GNOME/glade).
Installation
============
The latest version of pygubu requires Python >= 3.8
You can install pygubu-designer using:
### pip
```
pip install pygubu-designer
```
### Arch Linux ([AUR](https://aur.archlinux.org/packages/pygubu-designer))
```
yay pygubu-designer
```
### Notes for Windows Users:
If your Python installation directory contains spaces (e.g., `C:\Program Files\Python312`), you may encounter errors. Use one of the following solutions:
1. Use quotation marks when running commands:
```
"C:\Program Files\Python312\Scripts\pygubu-designer.exe"
```
2. Add Python to your system's PATH:
- Open **System Properties** > **Environment Variables**.
- Under **System Variables**, select `Path` > **Edit**.
- Add the path to your Python installation (e.g., `C:\Program Files\Python312`).
3. Use the short pathname format for directories with spaces:
```
C:\PROGRA~1\Python312\Scripts\pygubu-designer.exe
```
Screenshot
==========
<img src="pygubu-designer.png" alt="pygubu-desinger.png">
Usage
=====
Type on the terminal one of the following commands depending on your system.
### Unix-like systems
```
pygubu-designer
```
### Windows
```
C:\Python3\Scripts\pygubu-designer.exe
```
Where `C:\Python3` is the path to **your** Python installation directory.
Now, you can start creating your tkinter application using the widgets that you
find in the top panel called `Widget Palette`.
After you finished creating your _UI definition_, save it to a `.ui` file by
going to the top menu `File > Save`.
The following is a UI definition example called
[helloworld.ui](examples/helloworld/helloworld.ui) created using pygubu:
```xml
<?xml version='1.0' encoding='utf-8'?>
<interface version="1.2">
<object class="tk.Toplevel" id="mainwindow">
<property name="height">200</property>
<property name="resizable">both</property>
<property name="title" translatable="yes">Hello World App</property>
<property name="width">200</property>
<child>
<object class="ttk.Frame" id="mainframe">
<property name="height">200</property>
<property name="padding">20</property>
<property name="width">200</property>
<layout manager="pack">
<property name="expand">true</property>
<property name="side">top</property>
</layout>
<child>
<object class="ttk.Label" id="label1">
<property name="anchor">center</property>
<property name="font">Helvetica 26</property>
<property name="foreground">#0000b8</property>
<property name="text" translatable="yes">Hello World !</property>
<layout manager="pack">
<property name="side">top</property>
</layout>
</object>
</child>
</object>
</child>
</object>
</interface>
```
Then, you should create your _application script_ as shown below
([helloworld.py](examples/helloworld/helloworld.py)):
```python
# helloworld.py
import pathlib
import tkinter as tk
import tkinter.ttk as ttk
import pygubu
PROJECT_PATH = pathlib.Path(__file__).parent
PROJECT_UI = PROJECT_PATH / "helloworld.ui"
class HelloworldApp:
def __init__(self, master=None):
# 1: Create a builder and setup resources path (if you have images)
self.builder = builder = pygubu.Builder()
builder.add_resource_path(PROJECT_PATH)
# 2: Load an ui file
builder.add_from_file(PROJECT_UI)
# 3: Create the mainwindow
self.mainwindow = builder.get_object('mainwindow', master)
# 4: Connect callbacks
builder.connect_callbacks(self)
def run(self):
self.mainwindow.mainloop()
if __name__ == '__main__':
app = HelloworldApp()
app.run()
```
Note that instead of `helloworld.ui` in the following line:
```python
PROJECT_UI = PROJECT_PATH / "helloworld.ui"
```
You should insert the _filename_ (or path) of your just saved UI definition.
Note also that instead of `'mainwindow'` in the following line:
```python
self.mainwindow = builder.get_object('mainwindow', master)
```
You should have the name of your _main widget_ (the parent of all widgets),
otherwise you will get an error similar to the following:
Exception: Widget not defined.
See [this](https://github.com/alejandroautalan/pygubu/issues/40) issue for
more information.
Documentation
=============
Visit the [wiki](https://github.com/alejandroautalan/pygubu-designer/wiki) for
more documentation.
The following are some good tkinter (and tk) references:
- [TkDocs](http://www.tkdocs.com)
- [Graphical User Interfaces with Tk](https://docs.python.org/3/library/tk.html)
- [Tkinter 8.5 reference: a GUI for Python](https://tkdocs.com/shipman)
- [An Introduction to Tkinter](http://effbot.org/tkinterbook) [(archive)](http://web.archive.org/web/20200504141939/http://www.effbot.org/tkinterbook)
- [Tcl/Tk 8.5 Manual](http://www.tcl.tk/man/tcl8.5/)
You can also see the [examples](examples) directory or watch [this introductory video tutorial](http://youtu.be/wuzV9P8geDg).
History
=======
See the list of changes [here](HISTORY.md).
Raw data
{
"_id": null,
"home_page": null,
"name": "pygubu-designer",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "gui, tkinter, designer",
"author": null,
"author_email": "Alejandro Autalan <alejandroautalan@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/8f/ba/5facb8a3172c5fa9cea85921937699c1a1cb6ab1bb6795549f450b6aee76/pygubu_designer-0.40.1.tar.gz",
"platform": null,
"description": "\n[Leer en Espa\u00f1ol](Documentation/README/es.md). More translations [here](Documentation/README)\n\nWelcome to Pygubu!\n============================================\n\n`Pygubu` is a [RAD tool](https://en.wikipedia.org/wiki/Rapid_application_development) to enable _quick_ and _easy development of user interfaces_ for the Python's `tkinter` module.\n\nThe user interfaces designed are saved as [XML](https://en.wikipedia.org/wiki/XML) files, and, by using the _pygubu builder_, these can be loaded by applications dynamically as needed.\n\nPygubu is inspired by [Glade](https://gitlab.gnome.org/GNOME/glade).\n\nInstallation\n============\n\nThe latest version of pygubu requires Python >= 3.8\n\nYou can install pygubu-designer using:\n\n### pip\n\n```\npip install pygubu-designer\n```\n### Arch Linux ([AUR](https://aur.archlinux.org/packages/pygubu-designer))\n```\nyay pygubu-designer\n```\n### Notes for Windows Users:\n\nIf your Python installation directory contains spaces (e.g., `C:\\Program Files\\Python312`), you may encounter errors. Use one of the following solutions:\n\n1. Use quotation marks when running commands:\n\n```\n\n\"C:\\Program Files\\Python312\\Scripts\\pygubu-designer.exe\"\n```\n\n2. Add Python to your system's PATH:\n- Open **System Properties** > **Environment Variables**.\n- Under **System Variables**, select `Path` > **Edit**.\n- Add the path to your Python installation (e.g., `C:\\Program Files\\Python312`).\n\n3. Use the short pathname format for directories with spaces:\n\n\n```\n\nC:\\PROGRA~1\\Python312\\Scripts\\pygubu-designer.exe\n```\n\nScreenshot\n==========\n\n<img src=\"pygubu-designer.png\" alt=\"pygubu-desinger.png\">\n\n\nUsage\n=====\n\nType on the terminal one of the following commands depending on your system.\n\n### Unix-like systems\n\n```\npygubu-designer\n```\n\n### Windows\n\n```\nC:\\Python3\\Scripts\\pygubu-designer.exe\n```\n\nWhere `C:\\Python3` is the path to **your** Python installation directory.\n\nNow, you can start creating your tkinter application using the widgets that you\nfind in the top panel called `Widget Palette`.\n\nAfter you finished creating your _UI definition_, save it to a `.ui` file by\ngoing to the top menu `File > Save`.\n\nThe following is a UI definition example called\n[helloworld.ui](examples/helloworld/helloworld.ui) created using pygubu:\n\n\n```xml\n<?xml version='1.0' encoding='utf-8'?>\n<interface version=\"1.2\">\n <object class=\"tk.Toplevel\" id=\"mainwindow\">\n <property name=\"height\">200</property>\n <property name=\"resizable\">both</property>\n <property name=\"title\" translatable=\"yes\">Hello World App</property>\n <property name=\"width\">200</property>\n <child>\n <object class=\"ttk.Frame\" id=\"mainframe\">\n <property name=\"height\">200</property>\n <property name=\"padding\">20</property>\n <property name=\"width\">200</property>\n <layout manager=\"pack\">\n <property name=\"expand\">true</property>\n <property name=\"side\">top</property>\n </layout>\n <child>\n <object class=\"ttk.Label\" id=\"label1\">\n <property name=\"anchor\">center</property>\n <property name=\"font\">Helvetica 26</property>\n <property name=\"foreground\">#0000b8</property>\n <property name=\"text\" translatable=\"yes\">Hello World !</property>\n <layout manager=\"pack\">\n <property name=\"side\">top</property>\n </layout>\n </object>\n </child>\n </object>\n </child>\n </object>\n</interface>\n```\n\nThen, you should create your _application script_ as shown below\n([helloworld.py](examples/helloworld/helloworld.py)):\n\n```python\n# helloworld.py\nimport pathlib\nimport tkinter as tk\nimport tkinter.ttk as ttk\nimport pygubu\n\nPROJECT_PATH = pathlib.Path(__file__).parent\nPROJECT_UI = PROJECT_PATH / \"helloworld.ui\"\n\n\nclass HelloworldApp:\n def __init__(self, master=None):\n # 1: Create a builder and setup resources path (if you have images)\n self.builder = builder = pygubu.Builder()\n builder.add_resource_path(PROJECT_PATH)\n\n # 2: Load an ui file\n builder.add_from_file(PROJECT_UI)\n\n # 3: Create the mainwindow\n self.mainwindow = builder.get_object('mainwindow', master)\n\n # 4: Connect callbacks\n builder.connect_callbacks(self)\n\n def run(self):\n self.mainwindow.mainloop()\n\n\nif __name__ == '__main__':\n app = HelloworldApp()\n app.run()\n\n```\n\nNote that instead of `helloworld.ui` in the following line:\n\n```python\nPROJECT_UI = PROJECT_PATH / \"helloworld.ui\"\n```\n\nYou should insert the _filename_ (or path) of your just saved UI definition.\n\n\nNote also that instead of `'mainwindow'` in the following line:\n\n```python\nself.mainwindow = builder.get_object('mainwindow', master)\n```\n\nYou should have the name of your _main widget_ (the parent of all widgets),\notherwise you will get an error similar to the following:\n\n Exception: Widget not defined.\n\nSee [this](https://github.com/alejandroautalan/pygubu/issues/40) issue for\nmore information.\n\n\nDocumentation\n=============\n\nVisit the [wiki](https://github.com/alejandroautalan/pygubu-designer/wiki) for\nmore documentation.\n\n\nThe following are some good tkinter (and tk) references:\n\n- [TkDocs](http://www.tkdocs.com)\n- [Graphical User Interfaces with Tk](https://docs.python.org/3/library/tk.html)\n- [Tkinter 8.5 reference: a GUI for Python](https://tkdocs.com/shipman)\n- [An Introduction to Tkinter](http://effbot.org/tkinterbook) [(archive)](http://web.archive.org/web/20200504141939/http://www.effbot.org/tkinterbook)\n- [Tcl/Tk 8.5 Manual](http://www.tcl.tk/man/tcl8.5/)\n\n\nYou can also see the [examples](examples) directory or watch [this introductory video tutorial](http://youtu.be/wuzV9P8geDg).\n\n\nHistory\n=======\n\nSee the list of changes [here](HISTORY.md).\n",
"bugtrack_url": null,
"license": "GPL-3",
"summary": "A simple GUI designer for the python tkinter module",
"version": "0.40.1",
"project_urls": {
"Documentation": "https://github.com/alejandroautalan/pygubu-designer#readme",
"Issues": "https://github.com/alejandroautalan/pygubu-designer/issues",
"Source": "https://github.com/alejandroautalan/pygubu-designer"
},
"split_keywords": [
"gui",
" tkinter",
" designer"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "dd517964b94c190acdc4b0f1d528b6878d203ffd0bb8002f308105c70a780f9a",
"md5": "3ad79e0eab2edbeba11cdc30e7a1d9ee",
"sha256": "d0487894a4b2b3c10249395cd99172001cf8d6d150d513725e84fce5c4ee83ff"
},
"downloads": -1,
"filename": "pygubu_designer-0.40.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3ad79e0eab2edbeba11cdc30e7a1d9ee",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 420359,
"upload_time": "2025-01-25T20:07:39",
"upload_time_iso_8601": "2025-01-25T20:07:39.790348Z",
"url": "https://files.pythonhosted.org/packages/dd/51/7964b94c190acdc4b0f1d528b6878d203ffd0bb8002f308105c70a780f9a/pygubu_designer-0.40.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8fba5facb8a3172c5fa9cea85921937699c1a1cb6ab1bb6795549f450b6aee76",
"md5": "77efefc4e4b9aa10c8de33db20fa270a",
"sha256": "88667435f3ff6ba03f538035f91a22a02cab9b4bfe25aea9a0ce76ebd87e7530"
},
"downloads": -1,
"filename": "pygubu_designer-0.40.1.tar.gz",
"has_sig": false,
"md5_digest": "77efefc4e4b9aa10c8de33db20fa270a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 986467,
"upload_time": "2025-01-25T20:07:45",
"upload_time_iso_8601": "2025-01-25T20:07:45.712162Z",
"url": "https://files.pythonhosted.org/packages/8f/ba/5facb8a3172c5fa9cea85921937699c1a1cb6ab1bb6795549f450b6aee76/pygubu_designer-0.40.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-25 20:07:45",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "alejandroautalan",
"github_project": "pygubu-designer#readme",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pygubu-designer"
}