Skip to content

item_resize_callback not called for child windows #2527

@ntn98

Description

@ntn98

Version: 2.0.0
Operating System: Windows 11

When bound to an item_handler_registry with an item_resize_handler, the child_window container will not trigger the callback when resized with the mouse.

To Reproduce

Steps to reproduce the behavior:

  1. create item_handler_registry with an item_resize_handler
  2. create window with child_window and flags resizable_x and resizable_y set as True
  3. bind the item_handler_registry to the child_window
  4. run the program and resize the child_window by dragging the borders

Expected behavior

The callback in of the item_resize_handler should be called when the container is resized

Standalone, minimal, complete and verifiable example

import dearpygui.dearpygui as dpg

dpg.create_context()
dpg.create_viewport(title="Test - Child window resize callback", width=800, height=800)

def child_window_resized(_sender, _app_data):
    print("Child window resized")

with dpg.item_handler_registry(tag="resize handler"):
    dpg.add_item_resize_handler(callback=child_window_resized)

with dpg.window():
    dpg.set_primary_window(dpg.last_item(), True)
    with dpg.child_window(tag="cw", resizable_x=True, resizable_y=True):
        dpg.add_text("Child window 1")

dpg.bind_item_handler_registry("cw", "resize handler")
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions