Resizable child windows and split panes for DearPyGUI
Project description
Resizeable DearPyGUI Child Windows
I was getting annoyed that my child windows weren't resizeable, so I decided to make them ALL resizeable by monkey-patching the add_child_window function.
Installation
pip install dearpygui-resizablechildwindow
Requires Python 3.14+ and DearPyGUI 2.3+.
Usage
Drop-in replacement (easiest)
Call patch_dpg() once at startup. Every dpg.add_child_window and dpg.child_window
call in your entire codebase gains drag handles automatically — no other changes needed.
import dearpygui.dearpygui as dpg
import dearpygui_resizablechildwindow
dearpygui_resizablechildwindow.patch_dpg()
dpg.create_context()
dpg.create_viewport(title="My App", width=900, height=600)
dpg.setup_dearpygui()
with dpg.window(tag="main"):
# Now resizable by default — drag the grey strip on the right/bottom edges
with dpg.child_window(width=400, height=300) as cw:
dpg.add_text("Drag the right or bottom edge to resize me")
dpg.show_viewport()
dpg.set_primary_window("main", True)
dpg.start_dearpygui()
dpg.destroy_context()
To opt a specific window out of resizing, pass resizable_x=False, resizable_y=False:
with dpg.child_window(width=200, height=100, resizable_x=False, resizable_y=False):
dpg.add_text("Fixed size, no handles")
Explicit import (selective use)
from dearpygui_resizablechildwindow import add_child_window, child_window
# Function style
cw = add_child_window(width=300, height=200, parent="main")
dpg.add_text("content", parent=cw)
# Context manager style
with child_window(width=300, height=200, parent="main") as cw:
dpg.add_text("content")
Both functions accept every parameter that dpg.add_child_window accepts, plus two extras:
| Extra param | Default | Description |
|---|---|---|
min_width |
20 |
Minimum content width when dragging |
min_height |
20 |
Minimum content height when dragging |
The only default that changes from stock DearPyGUI: resizable_x and resizable_y are
True here (they default to False in DearPyGUI).
When width=0 or height=0 (auto-size), that axis falls back to DearPyGUI's native
resizable_x/resizable_y flag instead of adding a custom handle.
Split panes
HSplit and VSplit give you two panes with a draggable divider between them. They
auto-resize when the host window is resized.
from dearpygui_resizablechildwindow import HSplit, VSplit
with dpg.window(tag="main"):
# Left / right split, starting at 40% left
h = HSplit(parent="main", ratio=0.4)
dpg.add_text("Left panel", parent=h.left)
dpg.add_text("Right panel", parent=h.right)
# Top / bottom split
v = VSplit(parent="main", ratio=0.5)
dpg.add_text("Top panel", parent=v.top)
dpg.add_text("Bottom panel", parent=v.bottom)
Constructor parameters (same for both):
| Parameter | Default | Description |
|---|---|---|
parent |
required | DearPyGUI tag of the containing window or pane |
ratio |
0.5 |
Initial size of the first pane as a fraction of available space |
min_pane_size |
20 |
Minimum pixel size for either pane |
Properties:
h.left,h.right— DearPyGUI tags for the left and right panesv.top,v.bottom— DearPyGUI tags for the top and bottom panes.tag— tag of the outermost group item (useful for nesting)
Methods:
.set_size(width, height)— manually update total dimensions (called automatically on parent resize).destroy()— clean up all DearPyGUI items owned by this split
Splits resize proportionally when their parent window is resized. Hover over the divider to see it highlight blue; drag to resize.
How it works
- A 6 px
child_windowstrip is placed alongside your content window inside a zero-spacing group. Dragging the strip updates the content window's width/height viadpg.set_item_width/dpg.set_item_height. - Drag state is tracked with
dpg.add_mouse_click_handler+dpg.is_item_hoveredat click time, thendpg.add_mouse_drag_handlerfor cumulative deltas. - Parent resize is detected with
dpg.add_item_resize_handler(works on bothmvWindowAppItemandmvChildWindowin DearPyGUI 2.3).
License
I'll get GitHub to add a license here after publishing to GitHub and eventually to PyPI. For now, just assume it's MIT or something. IDC what you use it for, it was 2 shot vibe coded anyways.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dearpygui_resizablechildwindow-0.1.0.tar.gz.
File metadata
- Download URL: dearpygui_resizablechildwindow-0.1.0.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af3d06a9d17590c639a88d17db81889816abca90149bc08b260dae3aef383b3e
|
|
| MD5 |
f1fe2b2df830a57c701a1f7c6ec7d01d
|
|
| BLAKE2b-256 |
09c826078c6ccaec60c792db42c03204bc4c7545e1d53ee94b1c794cfef8db65
|
File details
Details for the file dearpygui_resizablechildwindow-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dearpygui_resizablechildwindow-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b575f10b0c753f284809c95cda6cc686e8fe256d4bc46fbf8bef9d0be63e7a58
|
|
| MD5 |
5c043a8753463bba173da0ef64726bb8
|
|
| BLAKE2b-256 |
6f1789e9eaefce2771c7191d81ed6e88d2a09a5063739af29cf590045ffa0345
|