imgui_bundle
imgui_bundle copied to clipboard
Disappeared or renamed bindings in Dear ImGui (get_window_content_region_max, etc.)
after upgrading from 1.3 to v1.6 (pip) AttributeError: module 'imgui_bundle._imgui_bundle.imgui' has no attribute 'get_window_content_region_max'
Also, I found that when using a pure glfw backend, glfw has to be imported before imgui-bundle (which was not the case previously)
after upgrading from 1.3 to v1.6 (pip) AttributeError: module 'imgui_bundle._imgui_bundle.imgui' has no attribute 'get_window_content_region_max'
Dear ImGui Bundle follows closely the API from Dear ImGui: it is always using the very latest version.
Rarely, some functions are deprecated in the ImGui API. You can find which one where deprecated in the ImGui releases page, and how to adapt your code.
For example, Dear ImGui Bundle version v1.6.0 is based on Dear ImGui v1.91.5.
In your case, you can open the ImGui releases page, and search for GetWindowRegionContentMax (which is the C++ equivalent of get_window_content_region_max)
You will there see some notes about this:
v1.91.0 Obsoleted GetContentRegionMax(), GetWindowContentRegionMin() and GetWindowContentRegionMax(). (information thread: https://github.com/ocornut/imgui/issues/7838) You should never need those functions! You can do everything in less a confusing manner by only using GetCursorScreenPos() and GetContentRegionAvail(). Also always consider that if you are using GetWindowPos() and GetCursorPos() you may also be making things unnecessarily complicated. I repeat: You can do everything with GetCursorScreenPos() and GetContentRegionAvail()! GetWindowContentRegionMax().x - GetCursorPos().x --> GetContentRegionAvail().x GetWindowContentRegionMax().x + GetWindowPos().x --> GetCursorScreenPos().x + GetContentRegionAvail().x // when called from left edge of window GetContentRegionMax() --> GetContentRegionAvail() + GetCursorScreenPos() - GetWindowPos() // right edge in local coordinates GetWindowContentRegionMax().x - GetWindowContentRegionMin().x --> GetContentRegionAvail() // when called from left edge of window
Also, I found that when using a pure glfw backend, glfw has to be imported before imgui-bundle (which was not the case previously)
This is strange. A possible reason is in __glfw_set_search_path.py, which will try to favor the glfw library bundled with imgui_bundle (this is required when using hello_imgui or immapp, i.e. when not using a pure python backend).
In your case, importing glfw before imgui_bundle will favor your own version of glfw (which is possibly different). I did a commit with some more details about this.
Thanks, updated my code.