Skip to content

Tools and Widgets

Raccoon edited this page Feb 10, 2024 · 61 revisions

The following small apps and widgets have been made with Dear PyGui. As these examples can be instructional for other developers, they are shared here. Click the images to visit the GitHub repositories.

Tools and widgets made with Dear PyGui

Edit theme plugin

The EditThemePlugin for Dear PyGui allows you to change theme settings, e.g. the font color or spacing of elements, and save them to a theme file that can be used in other Dear PyGui applications.

Dear PyGui theme editor

File explorers

In addition to the file explorer built into Dear PyGui, there are two file explorer libraries that offer extra functionality, e.g. file_dialog and Dear PyGui Extend: File browser. Dear PyGui's file explorer is the same as imgui's file explorer and cannot be customized in any way. The two file explorers listed here are written in Python and Dear PyGui and can be customized in Python if required. Alternative file browsers (not created with Dear PyGui) are xdialog or windows_filedialogs (Windows only).

File_dialog

File_dialog is a beautiful file dialog add-on for DearPyGui applications, released under an MIT license.

Features

  • Nice and beautiful interface
  • Modern icons
  • Shortcut menu
  • Drives menu
  • Customization of the the file dialog window
  • Can be used at all time by using show_file_dialog()

file_dialog

Dear PyGui Extend: File browser

Dear PyGui Extend offers a custom file browser with extended functionality compared to the built-in file browser. It is released under an MIT license.

Features

  • Supports file sequence entries: image.001.jpg, image.002.jpg, image.003.jpg --> 'image.###.jpg (001-003)'
  • Multi-selection (pick single or multiple files/sequences)
  • Breadcrumb path with navigation icons & folder quick access
  • Filetype filters
  • Sorting (smart sorting for collapsed sequences)
  • Draggable items (ability to expand file sequences on a drop callback)

Dear PyGui Extend: file browser

DearPyGui-Markdown

DearPyGui-Markdown is a markdown implementation that supports nearly all basic markdown functionality in Dear PyGui, as well as provides additional support in the form of text customization (color, size) as a custom HTML tag.

Markdown implementation in DPG

Wrapping & aligning text and colored words

This tools extends Dear PyGui's text layout by allowing a different color and/or font type and size for each word while wrapping and aligning the text appropriately.

Wrapping & aligning text and colored words

Extended Date Picker

A date picker with extended functionality compared to the date picker that is built into Dear PyGui.

Benefits

  • Works with datetime, not dictionaries.
  • You can set both minimum and maximum value limits.
  • Supports translations
  • Can be customized for your needs (for example, you can add tooltips on items).

Drawbacks

  • Wrong width and no calendar visible in the first frame
  • No support for dpg.get_value/dpg.set_value, you have to work directly with the class object (DatePicker().set_value/DatePicker().get_value)
  • Python >= 3.11 (to support python < 3.11, remove Self/typing.Self)

Extended Date Picker

DearPyGui-Grid

DearPyGui-Grid is a layout management tool for Dear PyGui. Grid does not create or use items for layout aids. Instead, it emulates a table-like structure and works by leveraging common configuration options supported by most items.

Features

  • create simple to complex layouts without the messy web of group, table, theme, and spacer items
  • position widgets in individual cells or over a cell range
  • supports overlapping widgets
  • edge-level padding customization per-slot (row/column) or per widget
  • control spacing between rows and columns
  • static and dynamic sizing (policy emulation)
  • optional overlay outlining the grid and its' slots - useful for debugging or designing layouts

DearPyGui Grid

Dear PyGui Map Widget

The Dear PyGui Map Widget allows for an interactive map based on OpenStreetMap data. The user can pan in all directions and zoom in and out of areas. The widget caches all map tiles that have been loaded and shown.

Dear PyGui Map Widget

DPG swiss controls

DPG Swiss controls is a small library made with Dear PyGui with a dependency on Numpy and Pandas. It contains a number of tools, including displaying DataFrames and managing items on a grid. An example of the latter is shown below.

DPG Swiss controls

Automatically scrolling logger

Automatically scrolling logger window that meets the following requirements.

  • Regularly update
  • Scrollable
  • Ability to automatically scroll to newest entry
  • Ability to show and hide the log with a toggle button
  • Text should be selectable
  • Automatic scrolling can be turned on and off

Automatically scrolling window

Dear PyGui Extend: Layout

A simple, responsive, text-based layouting system that abstracts table creation process away from the user.

Dear PyGui Extend: layout

Dear PyGui Extend: Add movable groups

Add Drag'n'drop ability to groups ("swap" or "replace" behaviors).

Dear PyGui Extend: movable groups

Cresliant node editor

Cresliant is a powerful node-based image editor made in Python. It offers an easy way to manipulate and enhance images through a user-friendly interface. With Cresliant, users can take advantage of a wide range of features and functionalities, all powered by Python's extensive libraries for image processing.

Cresliant

Loading and unloading textures

Loading textures takes up a considerable amount of GPU memory. This textures example app optimizes RAM consumption by loading images into memory when necessary and unloading images when the image is no longer visible.

Loading and unloading textures

Progress bar (using threading)

An example implementation of a progress bar for Dear PyGui. The user can can pause, resume or reset the progress bar. It uses threading to asynchronously run the progress bar, so that it doesn't interfere with the rest of the application or GUI.

Progress bar (using threading)

Dimension Me

DimensionMe is an application for sending multiple images to a neural network site and retrieving and showing the resulting, processed images. The application combines networking with loading images from the web API as textures, GUI and threading.

Dimension Me

Image to PDF converter

Image to PDF converter with drag-and-drop functionality (Windows only) for adding image files and converting to a PDF document. It also shows an image while hovering over a file name or miniature preview image. In addition, the application supports a theming system where the user can select one of the predefined themes.

Image to PDF converter

MQTT Chat

MQTT chat, made with Dear PyGui, that supports the following glyphs (characters).

  • Latin extended
  • Cyrillic
  • Japanese
  • Chinese (traditional and simplified)
  • Vietnamese
  • Thai
  • Korean

MQTT Chat

Slippi labeler

Slippi labeler automatically fetches a list of players from a Start.gg url. During a tournament, use the Slippi Labeler to group games into sets. Label the players on each port. Then at the end, export the labels for record keeping.

Slippi labeler

PyFaceRenderer

PyFaceRenderer uses an off-screen renderer for rendering face models and displays the result using Dear PyGui.

PyFaceRenderer

Vaultea encryption app

Vaultea is simple and easy to use file encryption app. It supports batch file processing and folder encryption while ensuring data authenticity.

Vaultea encryption app

Calculator

A simple calculator demonstrating how to create buttons and use callbacks.

Calculator

RSTP video stream viewer

RSTP video stream viewer, e.g. for viewer for security cameras, is a small utility that shows four video streams concurrently. It provides an example of how to use threading combined with video playback.

Drag and Drop from desktop or other applications (Windows only)

Working Drag-and-drop widget for Dear PyGui for dragging files from File Explorer or even the Desktop. It's Windows only as it uses pywin32 for Windows API calls.

Drag and drop

Drag and Drop nodes in Node Editor (all operating systems)

Example of dragging and dropping nodes onto the Node Editor in Dear PyGui.

Drag and drop node editor

Looking for more ideas?

In case you'd like to see more examples, you can check out the Showcase gallery, that highlights a variety of interesting apps made with Dear PyGui.

You can also have a look at the Showcase apps for older Dear PyGui versions. These apps were made with older versions of Dear PyGui. The release of Dear PyGui version 1.0 included a few breaking changes, so that these apps are not compatible with the latest version.