### Install Pygubu in developer mode Source: https://github.com/alejandroautalan/pygubu/wiki/DevHowto Navigate to the pygubu directory and install the package in editable mode. ```bash cd pygubu pip install -e ./ ``` -------------------------------- ### Project structure Source: https://github.com/alejandroautalan/pygubu/wiki/DevHowto The expected directory structure after completing the setup. ```text mypygubu-project/ ├── pygubu │   ├── doc │   ├── pygubu │   └── tests └── venv ``` -------------------------------- ### Install system dependencies on Debian Source: https://github.com/alejandroautalan/pygubu/wiki/DevHowto Install the required bash, git, and gettext packages on Debian-based distributions. ```bash # On debian based distributions apt install bash git gettext ``` -------------------------------- ### Install pygubu with pip Source: https://github.com/alejandroautalan/pygubu/blob/master/README.md Install the latest version of pygubu using pip. Requires Python >= 3.9. ```bash pip install pygubu ``` -------------------------------- ### Minimal tk.Toplevel UI definition (XML) Source: https://github.com/alejandroautalan/pygubu/wiki/Using-the-tk.Toplevel-Widget XML UI definition for a minimal tk.Toplevel window with a ttk.Frame and a ttk.Label showing 'Hello World!'. The window is resizable both ways and has a title 'Minimal toplevel example'. ```xml 200 both Minimal toplevel example 200 200 200 0 True 0 nsew 1 1 center {Helvetica} 36 {bold} #000081 40 10 Hello World! 0 True 0 nsew ``` -------------------------------- ### Check Python version Source: https://github.com/alejandroautalan/pygubu/wiki/DevHowto Verify the installed Python version in the bash console. ```bash # This is the python version installed here $ python --version Python 3.8.5 ``` -------------------------------- ### Create project directory Source: https://github.com/alejandroautalan/pygubu/wiki/DevHowto Create and enter a new directory for the project. ```bash mkdir mypygubu-project cd mypygubu-project ``` -------------------------------- ### Create virtual environment Source: https://github.com/alejandroautalan/pygubu/wiki/DevHowto Initialize a virtual environment named venv using the venv module. ```bash python3 -m venv venv ``` -------------------------------- ### Activate virtual environment Source: https://github.com/alejandroautalan/pygubu/wiki/DevHowto Activate the virtual environment for Windows or Unix-like systems. ```bash # Windows: source ./venv/Scripts/activate # Unix like: source venv/bin/activate ``` -------------------------------- ### Minimal tk.Toplevel Python application (toplevelminimal.py) Source: https://github.com/alejandroautalan/pygubu/wiki/Using-the-tk.Toplevel-Widget Python script that loads the UI file 'toplevelminimal.ui' using pygubu.Builder, creates the toplevel widget, and runs the mainloop. Includes a quit method and a main guard. ```python #!/usr/bin/python # File: toplevelminimal.py import os try: import tkinter as tk except: import Tkinter as tk import pygubu CURRENT_DIR = os.path.abspath(os.path.dirname(__file__)) class MyApplication: def __init__(self): #1: Create a builder self.builder = builder = pygubu.Builder() #2: Load an ui file builder.add_from_file(os.path.join(CURRENT_DIR, 'toplevelminimal.ui')) #3: Create the toplevel widget. self.mainwindow = builder.get_object('mainwindow') def quit(self, event=None): self.mainwindow.quit() def run(self): self.mainwindow.mainloop() if __name__ == '__main__': app = MyApplication() app.run() ``` -------------------------------- ### Clone Pygubu repository Source: https://github.com/alejandroautalan/pygubu/wiki/DevHowto Clone the official Pygubu repository from GitHub. ```bash git clone https://github.com/alejandroautalan/pygubu.git ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.