Skip to content

2.0.0

Latest
Compare
Choose a tag to compare
@KinoxKlark KinoxKlark released this 19 Apr 16:50
· 2 commits to master since this release
003804e

A new major release is finally here!

It has been a very long and intense road. But I finally managed to take some time to gather everything together and release this new version of pyimgui. The project started three years ago when I took the challenge to upgrade the internal DearImGui library version from 1.65 to 1.79 and then to 1.82. What started as a small upgrade revealed itself to be a massive modification and asked for a lot of change. So many changes that the decision has been made to release it under a new major version of pyimgui.

Over the years, many have participated in this achievement, and I don't have enough words to thank them enough.

Important note

This new major release changes some function names, removes the support of old obsoleted DearImGui functions, and changes the way some previously implemented functions are called (e.g. change of arguments type or order). It thus may break some old code bases, and some care should be taken if you wish to update an old project.

In future releases, I want to be more transparent and rigorous about what changes exactly to help developers update their code.

Announcements

  • Support for DearImGui 1.82 is now official. It implies that many modern features have now been ported to pyimgui. Future releases will tend to catch up with DearImGui.
  • Support for python 2.7, 3.3, 3.4, and 3.5 is now dropped. Pyimgui currently supports python 3.6, 3.7, 3.8, 3.9, 3.10, and 3.11. We also officially support Pypy 3.7, 3.8, and 3.9. It is always possible to compile from source in order to use pyimgui with another python version, however, test routines may not work correctly.
  • We now have a docking branch (see: docking) that is up-to-date with the corresponding branch of DearImGui 1.82. Please note that this is still a work in progress, and many features still need to be properly ported and will still be worked on.

New features

Pyimgui is now divided into two submodules:

  • imgui.core, which contains core functionalities and is equivalent to the old imgui namespace. Note that import imgui defaults to imgui.core such that we can still use imgui.xxx() as before.
  • imgui.internal, which gives access to very few (to be increased in future) internal DearImGui functions such as push_item_flag() and pop_item_flag().

New

  • Pyimgui now supports using the with keyword instead of the begin/end syntax of DearImGui. The old syntax is still valid; it is just a bonus for a better Pythonic experience. (#264, #271, thanks to @mCodingLLC)
  • Mapping of begin_combo() and end_combo(), which also work with the with keyword (#313, thanks to @Willy-JL)
  • Mapping of additional drawlist methods:
    • add_rect_filled_multicolor, add_quad, add_quad_filled, add_triangle, add_triangle_filled, add_bezier_cubic, add_bezier_quadratic, path_clear, path_line_to, path_fill_convex, path_stroke, path_arc_to, path_arc_to_fast, and path_rect (#312, thanks to @Godzil)
    • add_image_rounded() (#279, thanks to @Willy-JL)
  • Mapping of io.fonts.texture_desired_width (#287, thanks to @Willy-JL)
  • Add support for TTF custom glyph ranges and font config (#241, thanks to @saulthu)
  • Mapping of set_next_window_size_constraints(), set_scroll_here_x(), set_scroll_here_y(), slider_angle(), get_drag_drop_payload(), show_about_window(), is_item_edited(), is_item_activated(), is_item_deactivated(), is_item_deactivated_after_edit(), is_item_toggled_open(), get_background_draw_list(), get_foreground_draw_list(), input_text_with_hint(), set_next_item_width(), set_next_item_open(), get_tree_node_to_label_spacing(), add_input_character_utf16(), capture_mouse_from_app(), get_clipboard_text(), set_clipboard_text(), load_ini_settings_from_disk(), load_ini_settings_from_memory(), save_ini_settings_to_disk(), save_ini_settings_to_memory(), color_convert_u32_to_float4(), color_convert_float4_to_u32(), color_convert_rgb_to_hsv(), color_convert_hsv_to_rgb(), drag_scalar(), drag_scalar_N(), input_scalar(), input_scalar_N(), slider_scalar(), slider_scalar_N(), v_slider_scalar(), drag_float_range2(), drag_int_range2(), push_clip_rect(), pop_clip_rect()
  • Functions slider_xxx() and drag_xxx() now take a SLIDER_FLAGS_xxx flag as parameter
  • Mapping of tab functionality: begin_tab_bar(), end_tab_bar(), begin_tab_item(), end_tab_item(), tab_item_button(), set_tab_item_closed()
  • Mapping of table functionality: begin_table(), end_table(), table_next_row(), table_next_column(), table_set_column_index(), table_setup_column(), table_setup_scroll_freez(), table_headers_row(), table_header(), table_get_sort_specs(), table_get_column_count(), table_get_column_index(), table_get_row_index(), table_get_column_name(), table_get_column_flags(), table_set_background_color()
  • Mapping of drawdata.display_pos(), drawdata.display_size(), drawdata.frame_buffer_scale()
  • Mapping of guistyle.log_slider_deadzone, guistyle.tab_rounding, guistyle.tab_border_size, guistyle.tab_min_width_for_close_button, guistyle.selectable_text_align, guistyle.anti_aliased_line_use_tex, guistyle.circle_segment_max_error, guistyle.window_menu_button_position, guistyle.color_button_position, guistyle.cell_padding, guistyle.config_drag_click_to_input_text
  • Mapping of drawlist.add_ngon(), drawlist.add_ngon_filled(), drawlist.flags, drawlist.push_clip_rect(), drawlist.push_clip_rect_full_screen(), drawlist.pop_clip_rect(), drawlist.push_texture_id(), drawlist.pop_texture_id(), drawlist.get_clip_rect_min(), drawlist.get_clip_rect_max()
  • Change mapping of popup context functionality: begin_popup_context_item(), open_popup_on_item_click(), begin_popup_context_void(), is_popup_open()
  • Mapping of fontatlas.get_glyph_ranges_thai(), fontatlas.get_glyph_ranges_vietnamese()
  • Mapping of io.metrics_render_indices, io.metrics_render_windows, io.metrics_active_allocations, io.config_windows_move_from_title_bar_only, io.config_windows_move_from_title_bar_only, io.config_windows_memory_compact_timer, io.config_windows_memory_compact_timer, io.nav_inputs
  • invisible_button() now takes a flag as input
  • Added callback functionality to function that allows it in DarImGui
  • Added a ton of new flags:
    • NONE
    • STYLE_CELL_PADDING, STYLE_TAB_ROUNDING, STYLE_SELECTABLE_TEXT_ALIGN
    • BUTTON_NONE, BUTTON_MOUSE_BUTTON_LEFT, BUTTON_MOUSE_BUTTON_RIGHT, BUTTON_MOUSE_BUTTON_MIDDLE
    • KEY_PAD_ENTER
    • KEY_MOD_NONE, KEY_MOD_CTRL, KEY_MOD_SHIFT, KEY_MOD_ALT, KEY_MOD_SUPER, NAV_INPUT_ACTIVATE, NAV_INPUT_CANCEL, NAV_INPUT_INPUT, NAV_INPUT_MENU, NAV_INPUT_DPAD_LEFT, NAV_INPUT_DPAD_RIGHT, NAV_INPUT_DPAD_UP, NAV_INPUT_DPAD_DOWN, NAV_INPUT_L_STICK_LEFT, NAV_INPUT_L_STICK_RIGHT, NAV_INPUT_L_STICK_UP, NAV_INPUT_L_STICK_DOWN, NAV_INPUT_FOCUS_PREV, NAV_INPUT_FOCUS_NEXT, NAV_INPUT_TWEAK_SLOW, NAV_INPUT_TWEAK_FAST, NAV_INPUT_COUNT
    • WINDOW_NONE, WINDOW_NO_BACKGROUND, WINDOW_NO_MOUSE_INPUTS, WINDOW_UNSAVED_DOCUMENT, WINDOW_NO_DECORATION
    • COLOR_EDIT_NONE, COLOR_EDIT_NO_ALPHA, COLOR_EDIT_NO_PICKER, COLOR_EDIT_NO_OPTIONS, COLOR_EDIT_NO_SMALL_PREVIEW, COLOR_EDIT_NO_INPUTS, COLOR_EDIT_NO_TOOLTIP, COLOR_EDIT_NO_LABEL, COLOR_EDIT_NO_SIDE_PREVIEW, COLOR_EDIT_NO_DRAG_DROP, COLOR_EDIT_NO_BORDER, COLOR_EDIT_ALPHA_BAR, COLOR_EDIT_ALPHA_PREVIEW, COLOR_EDIT_ALPHA_PREVIEW_HALF, COLOR_EDIT_HDR, COLOR_EDIT_DISPLAY_RGB, COLOR_EDIT_DISPLAY_HSV, COLOR_EDIT_DISPLAY_HEX, COLOR_EDIT_UINT8, COLOR_EDIT_FLOAT, COLOR_EDIT_PICKER_HUE_BAR, COLOR_EDIT_PICKER_HUE_WHEEL, COLOR_EDIT_INPUT_RGB, COLOR_EDIT_INPUT_HSV, COLOR_EDIT_DEFAULT_OPTIONS
    • TREE_NODE_NONE, TREE_NODE_SPAN_AVAILABLE_WIDTH, TREE_NODE_SPAN_FULL_WIDTH, TREE_NODE_NAV_LEFT_JUPS_BACK_HERE
    • POPUP_NONE, POPUP_MOUSE_BUTTON_LEFT, POPUP_MOUSE_BUTTON_RIGHT, POPUP_MOUSE_BUTTON_MIDDLE, POPUP_MOUSE_BUTTON_MASK, POPUP_MOUSE_BUTTON_DEFAULT, POPUP_NO_OPEN_OVER_EXISTING_POPUP, POPUP_NO_OPEN_OVER_ITEMS, POPUP_ANY_POPUP_ID, POPUP_ANY_POPUP_LEVEL, POPUP_ANY_POPUP
    • SELECTABLE_NONE, SELECTABLE_DISABLED, SELECTABLE_ALLOW_ITEM_OVERLAP
    • COMBO_NONE
    • TAB_BAR_NONE, TAB_BAR_REORDERABLE, TAB_BAR_AUTO_SELECT_NEW_TABS, TAB_BAR_TAB_LIST_POPUP_BUTTON, TAB_BAR_NO_CLOSE_WITH_MIDDLE_MOUSE_BUTTON, TAB_BAR_NO_TAB_LIST_SCROLLING_BUTTONS, TAB_BAR_NO_TOOLTIP, TAB_BAR_FITTING_POLICY_RESIZE_DOWN, TAB_BAR_FITTING_POLICY_SCROLL, TAB_BAR_FITTING_POLICY_MASK, TAB_BAR_FITTING_POLICY_DEFAULT
    • TAB_ITEM_NONE, TAB_ITEM_UNSAVED_DOCUMENT, TAB_ITEM_SET_SELECTED, TAB_ITEM_NO_CLOSE_WITH_MIDDLE_MOUSE_BUTTON, TAB_ITEM_NO_PUSH_ID, TAB_ITEM_NO_TOOLTIP, TAB_ITEM_NO_REORDER, TAB_ITEM_LEADING, TAB_ITEM_TRAILING
    • TABLE_NONE, TABLE_RESIZABLE, TABLE_REORDERABLE, TABLE_HIDEABLE, TABLE_SORTABLE, TABLE_NO_SAVED_SETTINGS, TABLE_CONTEXT_MENU_IN_BODY
    • TABLE_ROW_BACKGROUND, TABLE_BORDERS_INNER_HORIZONTAL, TABLE_BORDERS_OUTER_HORIZONTAL, TABLE_BORDERS_INNER_VERTICAL, TABLE_BORDERS_OUTER_VERTICAL, TABLE_BORDERS_HORIZONTAL, TABLE_BORDERS_VERTICAL, TABLE_BORDERS_INNER, TABLE_BORDERS_OUTER, TABLE_BORDERS, TABLE_NO_BORDERS_IN_BODY, TABLE_NO_BORDERS_IN_BODY_UTIL_RESIZE
    • TABLE_SIZING_FIXED_FIT, TABLE_SIZING_FIXED_SAME, TABLE_SIZING_STRETCH_PROP, TABLE_SIZING_STRETCH_SAME
    • TABLE_NO_HOST_EXTEND_X, TABLE_NO_HOST_EXTEND_Y, TABLE_NO_KEEP_COLUMNS_VISIBLE, TABLE_PRECISE_WIDTHS
    • TABLE_NO_CLIP
    • TABLE_PAD_OUTER_X, TABLE_NO_PAD_OUTER_X, TABLE_NO_PAD_INNER_X
    • TABLE_SCROLL_X, TABLE_SCROLL_Y
    • TABLE_SORT_MULTI, TABLE_SORT_TRISTATE
    • TABLE_COLUMN_NONE, TABLE_COLUMN_DEFAULT_HIDE, TABLE_COLUMN_DEFAULT_SORT, TABLE_COLUMN_WIDTH_STRETCH, TABLE_COLUMN_WIDTH_FIXED, TABLE_COLUMN_NO_RESIZE, TABLE_COLUMN_NO_REORDER, TABLE_COLUMN_NO_HIDE, TABLE_COLUMN_NO_CLIP, TABLE_COLUMN_NO_SORT, TABLE_COLUMN_NO_SORT_ASCENDING, TABLE_COLUMN_NO_SORT_DESCENDING, TABLE_COLUMN_NO_HEADER_WIDTH, TABLE_COLUMN_PREFER_SORT_ASCENDING, TABLE_COLUMN_PREFER_SORT_DESCENDING, TABLE_COLUMN_INDENT_ENABLE, TABLE_COLUMN_INDENT_DISABLE
    • TABLE_COLUMN_IS_ENABLED, TABLE_COLUMN_IS_VISIBLE, TABLE_COLUMN_IS_SORTED, TABLE_COLUMN_IS_HOVERED
    • TABLE_ROW_NONE, TABLE_ROW_HEADERS
    • TABLE_BACKGROUND_TARGET_NONE, TABLE_BACKGROUND_TARGET_ROW_BG0, TABLE_BACKGROUND_TARGET_ROW_BG1, TABLE_BACKGROUND_TARGET_CELL_BG
    • FOCUS_NONE
    • HOVERED_ALLOW_WHEN_DISABLED
    • DRAG_DROP_NONE
    • SORT_DIRECTION_NONE, SORT_DIRECTION_ASCENDING, SORT_DIRECTION_DESCENDING
    • MOUSE_CURSOR_NOT_ALLOWED
    • COLOR_TAB, COLOR_TAB_HOVERED, COLOR_TAB_ACTIVE, COLOR_TAB_UNFOCUSED, COLOR_TAB_UNFOCUSED_ACTIVE
    • COLOR_TABLE_HEADER_BACKGROUND, COLOR_TABLE_BORDER_STRONG, COLOR_TABLE_BORDER_LIGHT, COLOR_TABLE_ROW_BACKGROUND, COLOR_TABLE_ROW_BACKGROUND_ALT
    • DATA_TYPE_S8, DATA_TYPE_U8, DATA_TYPE_S16, DATA_TYPE_U16, DATA_TYPE_S32, DATA_TYPE_U32, DATA_TYPE_S64, DATA_TYPE_U64, DATA_TYPE_FLOAT, DATA_TYPE_DOUBLE
    • INPUT_TEXT_NONE, INPUT_TEXT_ALWAYS_OVERWRITE, INPUT_TEXT_CHARS_SCIENTIFIC, INPUT_TEXT_CALLBACK_RESIZE, INPUT_TEXT_CALLBACK_EDIT
    • DRAW_NONE, DRAW_CLOSED, DRAW_ROUND_CORNERS_TOP_LEFT, DRAW_ROUND_CORNERS_TOP_RIGHT, DRAW_ROUND_CORNERS_BOTTOM_LEFT, DRAW_ROUND_CORNERS_BOTTOM_RIGHT, DRAW_ROUND_CORNERS_NONE, DRAW_ROUND_CORNERS_TOP, DRAW_ROUND_CORNERS_BOTTOM, DRAW_ROUND_CORNERS_LEFT, DRAW_ROUND_CORNERS_RIGHT, DRAW_ROUND_CORNERS_ALL
    • DRAW_LIST_NONE, DRAW_LIST_ANTI_ALIASED_LINES, DRAW_LIST_ANTI_ALIASED_LINES_USE_TEX, DRAW_LIST_ANTI_ALIASED_FILL, DRAW_LIST_ALLOW_VTX_OFFSET
    • FONT_ATLAS_NONE, FONT_ATLAS_NO_POWER_OF_TWO_HEIGHT, FONT_ATLAS_NO_MOUSE_CURSOR, FONT_ATLAS_NO_BAKED_LINES
    • CONFIG_NONE
    • BACKEND_NONE, BACKEND_RENDERER_HAS_VTX_OFFSET

Obsoleted

These objects have been marked as obsolete from DearImGui and will be removed in a future release

  • Attribute GuiStyle.circle_segment_max_error
  • Function get_content_region_available_width()
  • Function get_overlay_draw_list()
  • Function listbox_header()
  • Function listbox_footer()
  • Parameter also_over_items of begin_popup_context_window()
  • Parameter power of drag_float(), drag_float2(), drag_float3(), drag_float4(), slider_float(), slider_float2(), slider_float3(), slider_float4()
  • Flag INPUT_TEXT_ALWAYS_INSERT_MODE
  • Flags DRAW_CORNER_NONE, DRAW_CORNER_TOP_LEFT, DRAW_CORNER_TOP_RIGHT, DRAW_CORNER_BOTTOM_LEFT, DRAW_CORNER_BOTTOM_RIGHT, DRAW_CORNER_TOP, DRAW_CORNER_BOTTOM, DRAW_CORNER_LEFT, DRAW_CORNER_RIGHT, and DRAW_CORNER_ALL. Please, use DRAW_* flags instead.

Depreciated

These objects have been depreciated from DearImGui API and have been removed.

  • Removed io.display_visible_min
  • Removed io.display_visible_max
  • Renamed io.config_resize_windows_from_edges to io.config_windows_resize_from_edges.
  • Renamed set_scroll_here() to set_scroll_here_y()
  • is_mouse_dragging() does not take default arguments anymore.

Improved

  • Cleaning up of documentation and examples (#311, thanks to @tayler6000)
  • io.ini_file_name and io.log_file_name can now be set to None for disabling (#292)
  • Now is_item_deactivated() returns the actual value instead of the function callable (#287, thanks to @Willy-JL)
  • Improvement in SDL examples (#276, thanks to @pthom)
  • Some python annotations (#226, thanks to @Oliver-Dahlen)
  • Better build pipeline (#305)
  • A HACKING.md file now contains important information about contributions

Bug fixes

  • Fix - Framebuffer scale crash (#307, thanks to @Willy-JL)
  • Fix - Compilation on MinGW Windows (303, thanks to @Willy-JL)
  • Fix - Typo in CONFIG_VIEWPORTS_ENABLE flag (#297, thanks to @mCodingLLC)
  • Fix - Restoring the last glPolygonMode after rendering UI (#296, thanks to @laralex)
  • Fix - Auto-resizing input buffer (#291)
  • Fix - Typo in table_setup_scroll_freeze() function (#275, thanks to @Willy-JL)
  • Fix - is_popup_open() was wrongly passing str type to DearImGui (#275, thanks to @Willy-JL)
  • Fix - Color Edit Flags (#257)
  • Fix - imgui.image() was not work if texture_id exceeded 256 (#250, thanks to @mCodingLLC)
  • Fix - Example cannot close custom window bug (#224, thanks to @gqw)
  • Fix - Typo in README.md (#267, thanks to @rp-bot)
  • Add some missing flags MOUSE_CURSOR_NONE, MOUSE_CURSOR_HAND (#209, thanks to @learn-more)
  • And many more that were not part of individual PR; feel free to lose yourself in the commit list if needed! :)

Docking branch

A docking branch that is synced to the DearImGui 1.82 docking branch has been added. It is still a work in progress but can be used if needed via manual installation. A lot of work has been put into it.

Huge thanks to

Notes from authors

I also want to address a special thanks to @learn-more, who help me a lot in managing various PR and issues. Your help has been very precious. And also to @tayler6000 for his help with issues moderation.

We also consider providing the internal DearImGui implementation as a DLL. Some work has been made in that direction thanks to @pvallet (#229), but it has not been possible to propose this in 2.0.0 and is still under considerations for future release.

Writing this release note has been quite a ride. I hope that I did not forget anything or, more importantly, anyone. Thank you all again for your help. Enjoy!