News
This release mainly focuses on multithreading/synchronization issues - deadlocks, segfaults, race conditions. It also brings some enhancements - see the New Features section!
Please note that Dear PyGui is still not entirely thread-safe because some things like dpg.last_item() or the container stack are still shared among threads. We're going to fix this in the next release.
The next minor release will include an update of Dear ImGui, ImPlot, and ImNodes. We'll try to ship it soon, so this time it will hopefully be a short release cycle.
Also, because of changes to GitHub runners we had to remove Intel-based macOS builds. If you still need to support macOS on x86, you'll have to build DPG locally.
Changelog
New Features
- feat: added a scroll handler to easily track scrolling events #2588
- feat: focus and hover handlers can now track state changes like "mouse-in on the item" or "item lost focus" #2586
- feat: Item Registry tool (
show_item_registry) got quite a revamp #2593 - feat:
show_toolnow brings the tool window to front #2593 - feat: ability to get table column width, as well as bind a resize handler or a visible handler to the column #2591
- feat: ability to create synced tables #2592
Fixes
- perf: optimization of item lookup - no more slowing down when a lot of items are added (#2374) #2600
- fix: proper reference counting on Python objects - fixes object leaks (#2036) #2580
- feat:
destroy_contextnow waits for all callbacks to complete before shutting down DPG (#2020) #2580 - fix: a race condition between the callback queue and item deletion (segfaults when deleting custom series) (#2427) #2580
- fix: no more races in
set_frame_callback(#2269) #2580 - fix: no more deadlocks caused by conflicts between DPG mutex and the GIL (#2053, #2366) #2581
- fix:
get_item_statewas sometimes returning invalid state - this fixesis_item_*functions too (#2077) #2581 - fix:
get_text_sizeincorrectly returning[0, 0]in certain rare cases (#2167) #2581 - fix: all callbacks and handlers now honor the "manual callback management" mode (#2208) #2580
- fix: partial fix for functions erroneously returning
Noneinstead ofnullptr(may affect exceptions raised by DPG, removing cascaded exceptions) #2599 - feat:
split_frameimproved - thedelayargument is not needed anymore #2583- Note: from now on, if
destroy_contextgets called while another thread is waiting insplit_frame(e.g. in a callback), thesplit_framecall will raise an exception. Previously, it would just hang up. This allows the app to properly release waiting threads on shutdown. In complex apps, it might be a good idea to wrapsplit_framecalls with atry...exceptor awith suppressblock.
- Note: from now on, if
- fix:
indentproperty is now supported on tables #2595 - fix:
on_closenow works for popups (#2372) #2580 - fix: support for event handlers on tooltips #2594
- fix:
item_visiblehandler now passes the ID of the widget inapp_data, like other handlers do #2580 - fix: fonts bound to
table_rowdo get applied to the row #2595 - fix: corrected size calculations for the ring-style
loading_indicator+ some minor fixes onadd_loading_indicator(styles, navigation focus) #2590 - fix:
move_itemwon't allow moving to an incompatible parent #2600 - docs: a typo in
add_date_pickersummary #2448 - demo: fixed a bug with bar stacks #2522
Thank you!
Dear PyGui development is currently funded by a handful of gracious sponsors and we would like to thank them tremendously. We wouldn't be here with out you guys.
Thank you for supporting us.
If you or your company uses Dear PyGui, please consider supporting us! We need it now more than ever.
Also special thanks to @bzczb for his PR #2282. While it did not get merged, it nevertheless contains a valid fix for #2036, which was a rather complicated issue. We just happened to have two competing PRs and had to choose one or the other. #2282 was a good take on fixing the issue, which allowed us to double-check and validate some ideas. Thanks for the good job!
New Contributors
Full Changelog: v2.1.1...v2.2.0