github hoffstadt/DearPyGui v2.3.0
Version 2.3

12 hours ago

News

We've finally updated to a more recent version of Dear ImGui, 1.92.5! While it's not the newest version (the newest at the moment is 1.92.7), it's still relevant and brings a number of changes. See the section Dear ImGui Update below for more info.

We've also updated ImPlot (to v.0.17) and ImNodes (to latest commit), but these two libraries do not have any changes noticeable on DPG side.

Changelog

New Features

  • feat: Dear ImGui update to 1.92.5 #2610
  • feat: thread-local state #2611
    • Dear PyGui is now supposed to be entirely thread-safe. Starting with this release, things like the container stack and dpg.last_item() are thread-local, which removes conflicts when DPG is used from two threads simultaneously. See PR #2611 for details.
  • feat: added linux aarch64 build #2625
  • feat: item type information, provided as a separate module type_info.py #2631
  • feat: the "toggled open" handler can now fire on both "open" and "close" events #2626
    • Use two_way=True on add_item_toggled_open_handler to handle the "close" event.
  • feat: added one more theme to DearPyGui_Ext - see create_theme_imgui_classic(). This is also the theme that DPG / ImGui uses at startup by default. #2610
    • The other two themes (dark / light) have been updated from ImGui / ImPlot / ImNodes source code, as they actually come from those libraries. This only adds more colors to them; colors already present in DearPyGui_Ext have not changed.
  • win32: you can now configure whether Alt+Enter will switch the app to fullscreen mode - use configure_app(win32_alt_enter_fullscreen=True). #2610
    • This is a "feature" of DXGI (DirectX Graphics Infrastructure) and is therefore specific to Windows platform. It was enabled in all previous releases without an opt-out. Now, the default value for this option is False, which disables the hotkey. If you need to keep the old behavior, set it to True explicitly.

Fixes

  • perf: optimized list conversions #2613
  • fix: restored item aliases in node editor and other places (#2122) #2615
  • fix: PyObject leaks in custom series and other places #2617
  • fix: no more segfaults on custom_series with channel_count > 2 #2616
  • fix: segfault on deletion of an item residing in the container stack #2624
  • fix: binary compatibility with older C runtimes on Windows #2612
  • fix: add missing resized state for child_window #2538
  • fix: dpg.configure_item() ignores rect's translation #2574
  • docs: update node-editor.rst to fix broken link by removing expired token #2560

Dear ImGui Update

Here are the changes that new ImGui brings to DPG:

  • By far the most noticeable change is that ImGui now builds font atlas on-the-fly based on what text is being rendered.
    • We don't need to preload character glyphs anymore - no need for all those add_font_range calls! The font range functions are now no-op and deprecated. You just add a font, bind it, and it all magically works :).
    • You can even do configure_item(my_font, size=new_font_size)! (e.g. to change font size on the fly with a slider in app settings).
  • Also, fonts on high-DPI screens are now pixel-perfect - earlier, on macOS with Retina you'd be getting blurred text because of bitmap rescaling applied to the entire GUI. Now, if you're using a TTF font (not the built-in Proggy Clean), you'll get crisp boundaries of character glyphs.
  • Bugfix: Selectable items that are in the "selected" state are now correctly rendered with the mvThemeCol_Header color rather than with an average of mvThemeCol_Header and mvThemeCol_HeaderHovered. This was a regression introduced in DPG 2.0.
  • Buttons with repeat=True now produce the first "pressed" event (i.e. call the callback) on mouse-down - previously the user needed to hold the mouse button pressed for a while before the auto-repeat button started firing the callback. That wait interval was very short, so this change will probably go unnoticed by the end users. However, it might affect your callbacks if they are complicated enough to depend on this delay.
  • On child windows with both resize_x and resize_y, there's a resize grip in the lower right corner. It only shows up on hovering the corner and is quite unnoticeable with the default theme, but pretty much visible with the dark theme (see create_theme_imgui_dark() in DearPyGui_Ext).
  • Child windows can now be resizable on one axis and auto_resize on the other axis (this previously didn't work).
  • On dpg.window(), you can enable the Ctrl+C keyboard shortcut to copy window contents as text (useful for message boxes).
  • You can also disable docking on per-window basis (obviously only makes sense with docking enabled globally via configure_app).
  • On numeric input fields, it's possible to display zero value as an empty field, and accept empty input, treating it as a zero.
  • A number of new flags on tab_bar and tab have been added.
  • Tree nodes can now handle the left arrow key on keyboard and collapse nodes / navigate to parent node the way you'd expect a tree widget do :).
  • Tree nodes can also render lines that display the tree structure.
  • New styles and colors have been added.

Other changes to DPG related to this update:

  • Style Editor: removed all settings that cannot be configured via dpg.theme in order to avoid confusion - earlier versions included some settings that were inaccessible via DPG API and therefore could only be temporarily changed in Style Editor, without a way to preserve them or bake into your application.

Breaking Changes

We have a couple of minor breaking changes that will hopefully never surface in real world:

  1. Behavior of the pos argument has changed a little in certain rather unlikely scenarios. In particular, if you have the following:
  • a horizontal group,
  • one of the items within that group is positioned explicitly with pos or set_item_pos - let's call it an "absolutely positioned item",
  • it's not the last item, i.e. there are non-pos items after it in the same group,

    then in the new release all items that go after the absolutely positioned one within that group will be laid out differently. I hope no one uses such a complicated structure. Even if you bump into this, just reorganize your code a bit so that the absolutely positioned item lives in a regular, non-horizontal group (e.g. wrap it with dpg.group).
  1. With keyboard_navigation enabled via configure_app, drawlists (dpg.drawlist()) now display the "navigation cursor", i.e. the focus rectangle, just like other widgets do (buttons, etc.). Drawlists have always been navigable with keyboard navigation, but in old versions the navigation cursor was not displayed. This looked really weird, the cursor disappearing during navigation and the user having no idea where the focus currently is.

    If you need to hide the cursor, either make it transparent via a theme (see mvThemeCol_NavHighlight) or disable the drawlist by placing it into dpg.group(enabled=False). The latter prevents navigation from entering the drawlist at all (which is again different from old behavior because the drawlist was navigable back then). Note that dpg.drawlist currently ignores themes, so to hide the cursor you'd need to wrap the drawlist with a dpg.group and bind your theme to that group.

Known Issues

There's a known issue in Dear ImGui itself where selection background in input fields is misplaced by a couple of pixels - see ImGui ticket #9311. We'll eventually update ImGui again to fix the issue.

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.

New Contributors

Full Changelog: v2.2.0...v2.3.0

Don't miss a new DearPyGui release

NewReleases is sending notifications on new releases.