Skip to content

The "toggled open" handler can now fire on both "open" and "close" events#2626

Open
v-ein wants to merge 2 commits intohoffstadt:masterfrom
v-ein:feature/toggled-open-two-way
Open

The "toggled open" handler can now fire on both "open" and "close" events#2626
v-ein wants to merge 2 commits intohoffstadt:masterfrom
v-ein:feature/toggled-open-two-way

Conversation

@v-ein
Copy link
Copy Markdown
Collaborator

@v-ein v-ein commented Mar 28, 2026


name: Pull Request
about: Create a pull request to help us improve
title: The "toggled open" handler can now fire on both "open" and "close" events
assignees: @hoffstadt


Description:
This PR adds an option to add_item_toggled_open_handler to make the handler fire when the "open" state is toggled both from closed to open and vice versa, like it is in Dear ImGui. This allows the application to catch it when the user collapses a tree node or a collapsing header, and handle it as needed.

The new option effectively provides an opt-out from #1280.

This PR also fixes some typos in the codebase that I didn't want to put into a separate PR. None of them change DPG behavior.

Concerning Areas:
None.

v-ein added 2 commits March 29, 2026 01:56
…nts.

This helps circumvent the change introduced in hoffstadt#1280 and handle the close.
@v-ein v-ein requested a review from hoffstadt March 28, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant