Skip to main content

Components for DPG

Project description

dpg-components

"A component is a piece of the UI (user interface) that has its own logic and appearance. A component can be as small as a button, or as large as an entire page." Components are a powerful abstraction.

The goal of this project is to bring Components to DearPyGui

  • Components should be first class citizens, i.e. use the same API as regular DPG Items.
  • Components can contain other Components or regular DPG Items.
  • Reusability is achieved through composition.

How it works ?

Copy file DPGComponents.py into your project, then after import, you can interact with DPG as normal and also call the method "add_component" to add complex components to your project. You can also define your own components by implementing abstract class "DPGComponent".

from datetime import datetime
import dearpygui.dearpygui as dpg
import DPGComponents

def save_callback():
    print("Save Clicked")

dpg.create_context()
dpg.create_viewport()
dpg.setup_dearpygui()

with dpg.window(label="Example Window"):
    dpg.add_text("Hello world")
    dpg.add_button(label="Save", callback=save_callback)
    dpg.add_input_text(label="string")
    dpg.add_slider_float(label="float")

    ## add a Date Picker component
    dpg.add_component(dpg_components.DatePickerComp, tag=f'date_picker_1')
    # Set default date to today
    dpg.configure_item(f'date_picker_1', default_value = datetime.now().date())

dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()

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

dpgcomponents-0.0.4.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

dpgcomponents-0.0.4-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file dpgcomponents-0.0.4.tar.gz.

File metadata

  • Download URL: dpgcomponents-0.0.4.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for dpgcomponents-0.0.4.tar.gz
Algorithm Hash digest
SHA256 9fe4b8e5025c516740f3211609d2b748d21c8597fb0298fe9ad53146a4be06ef
MD5 bf2db3654038197f3ac9501d0c40cf75
BLAKE2b-256 474eea35b288056664b6ad64896b1cb40734cc207db16bec7fedd016de1e83ee

See more details on using hashes here.

File details

Details for the file dpgcomponents-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: dpgcomponents-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for dpgcomponents-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bb055f51bf2051607e4bbdeef9d8d913be7017988f024a4f2fa5c9c09884d9d3
MD5 b6eaa78436b7ce948592d6d698e52ee0
BLAKE2b-256 688752b397cf46be0879c7cc8b82d70b1dca29a7eaf0dff0717079e1d3a4a56d

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