Skip to main content

A simple library for creating GUI applications

Project description

PyGUIBuilder - README

Overview

Welcome to the PyGUIBuilder, designed to help you create GUI applications with ease. Whether you are building a simple tool or a complex application, our library provides everything you need.

Table of Contents

  1. Installation
  2. Getting Started
  3. Features
  4. Usage
  5. Examples
  6. License
  7. Thanks

Installation

To install the PyGUIBuilder, use pip:

pip install PyGUIBuilder

Getting Started

Creating your first GUI application is simple. Here’s a quick example to get you started:

import PyGUIBuilder

# Create the main application window
app = PyGUIBuilder.createWindow("My First App", "icon.ico", 400, 400)

# Create a label widget
label = PyGUIBuilder.createLabel(app, "Hello, World!", 1, 0)

# Run the application
PyGUIBuilder.run()

Features

  • Works on Windows
  • Ease of use: The library provides a simple and intuitive interface for creating GUI elements.
  • Widgets: Buttons, labels, text entries, buttons, radio buttons and many others.
  • Grid placement: placing widgets in rows and columns.
  • Alerts and Warnings: Simple dialog boxes for messages and warnings.

Usage

Creating a Window

To create a main application window, use the CreateWindow function:

import PyGUIBuilder

window = PyGUIBuilder.createWindow("My App", "icon.ico", 400, 400)

Adding Widgets

Widgets are the building blocks of a GUI application. You can add various widgets to your window.

Here's an example of adding a label:

label = PyGUIBuilder.createLabel(window, "Hello, World!", 1, 0)

Here's an example of adding a entrybox:

entry = PyGUIBuilder.createEntry(window, "text", 3, 0)

Here's an example of adding a button:

def callback():
   print("Button clicked!")

button = PyGUIBuilder.createButton(window, "Click Me!", callback, 2, 0)

Here's an example of adding a combobox:

langs = ["1", "2", "3", "4"]
combobox = PyGUIBuilder.createComboBox(window, langs, 1, 0)

Here's an example of messagebox:

PyGUIBuilder.showMessageBox("showinfo", "Information", "This is an info message.")
PyGUIBuilder.showMessageBox("showwarning", "Warning", "This is a warning message.")
PyGUIBuilder.showMessageBox("showerror", "Error", "This is an error message.")
PyGUIBuilder.showMessageBox("askquestion", "Question", "Are you sure?")
PyGUIBuilder.showMessageBox("askokcancel", "OK Cancel", "Do you want to continue?")
PyGUIBuilder.showMessageBox("askyesno", "Yes No", "Do you agree?")
PyGUIBuilder.showMessageBox("askretrycancel", "Retry Cancel", "Do you want to retry?")

Here's an example of adding a Checkbox:

PyGUIBuilder.createCheckbox(window, "text", 1, 0)

Here's an example of adding a RadioButton:

PyGUIBuilder.createRadioButton(window, "text", 1, 0)

Other Functions:

Clearing text in an entry box:

PyGUIBuilder.clearText(entry)

Setting text in an entry box:

PyGUIBuilder.setText(entry, "text")

Getting text from an entry box:

PyGUIBuilder.getText(entry)

Destroying an element:

PyGUIBuilder.destroyElement(label)

Getting selection on Combobox:

print(PyGUIBuilder.getComboBoxSelection(combobox))

Getting Checkbox state:

PyGUIBuilder.getCheckbox()

Getting RadioButton state:

PyGUIBuilder.getRadioButton()

Running the application:

PyGUIBuilder.run()

Examples

Simple Form

import PyGUIBuilder

def on_submit():
    r = PyGUIBuilder.getCheckbox(Robot)
    if r == 1:
        check = "Not a robot"
    else:
        check = "Robot"
    print(f"First Name: {PyGUIBuilder.getText(e_firstname)}, Last Name: {PyGUIBuilder.getText(e_lastname)}, Age: {PyGUIBuilder.getText(e_age)}, EMAIL: {PyGUIBuilder.getText(e_email)}, Phone number: {PyGUIBuilder.getText(e_phone_number)}, Password: {PyGUIBuilder.getText(e_password)}, {check}")

app = PyGUIBuilder.createWindow("Simple Form", "icon.ico", 400, 400)

l_firstname = PyGUIBuilder.createLabel(app, "First Name:", 1, 0)
e_firstname = PyGUIBuilder.createEntry(app, "", 1, 1)

l_lastname = PyGUIBuilder.createLabel(app, "Last Name:", 2, 0)
e_lastname = PyGUIBuilder.createEntry(app, "", 2, 1)

l_age = PyGUIBuilder.createLabel(app, "Age:", 3, 0)
e_age = PyGUIBuilder.createEntry(app, "", 3, 1)

l_email = PyGUIBuilder.createLabel(app, "EMAIL:", 4, 0)
e_email = PyGUIBuilder.createEntry(app, "", 4, 1)

l_phone_number = PyGUIBuilder.createLabel(app, "Phone number:", 5, 0)
e_phone_number = PyGUIBuilder.createEntry(app, "", 5, 1)

l_password = PyGUIBuilder.createLabel(app, "Password:", 6, 0)
e_password = PyGUIBuilder.createEntry(app, "", 6, 1)

Robot = PyGUIBuilder.createCheckbox(app, "I am not a robot", 8, 0)

submit_button = PyGUIBuilder.createButton(app, "Submit", on_submit, 9, 0)

PyGUIBuilder.run()

License

This project is licensed under the MIT License. See LICENSE for details.

Thanks

Thank you for using the PyGUIBuilder! We hope it helps you build amazing applications. If you have questions or need additional help, feel free to contact panovartem690@gmail.com.


Please keep in mind that there may be bugs and flaws.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyguibuilder-1.5.tar.gz (42.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PyGUIBuilder-1.5-py3-none-any.whl (41.1 kB view details)

Uploaded Python 3

File details

Details for the file pyguibuilder-1.5.tar.gz.

File metadata

  • Download URL: pyguibuilder-1.5.tar.gz
  • Upload date:
  • Size: 42.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for pyguibuilder-1.5.tar.gz
Algorithm Hash digest
SHA256 7951856235cfdb554d5b68c1c297c57ce77f517e4fe8abf8230dabc0d83806d1
MD5 45a4792148515832919f0294494644fe
BLAKE2b-256 af2048a4bbb46defa817e59be266a5051838df186061fc56787300c5c1e8a122

See more details on using hashes here.

File details

Details for the file PyGUIBuilder-1.5-py3-none-any.whl.

File metadata

  • Download URL: PyGUIBuilder-1.5-py3-none-any.whl
  • Upload date:
  • Size: 41.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for PyGUIBuilder-1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4945b448b49056041e935274c7022c3955d72858a1ee820fed7cd31c791edffc
MD5 1f867e9581d60bbd0103a2e5a3e8ee23
BLAKE2b-256 e69ee47becac8e92caa51d508e72af980bb8e276720c6bd498dedd00b15b52c7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page