Skip to content

Major speedups and bug fixes to CustomTreeCtrl and HyperTreeList #2088

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

cbeytas
Copy link
Contributor

@cbeytas cbeytas commented Jan 23, 2022

Improve speed of controls especially with a large number of items. Up to 10 - 100x speedup. Issues were:

  • CustomTreeCtrl extremely slow with Left ImageList enabled
  • Both trees extremely slow with over a thousand items added. Now is fully responsive with up to a million items.
  • Documentation updated and PEP8 fixes

CustomTreeCtrl version bump from 2.7 to 2.8
HyperTreeList version bump from 1.4 to 1.5

Fixes #2006
Fixes #1938
Fixes #1395
Fixes #2083
Fixes #2081
Fixes #1981
Fixes #1938
Fixes #1901
Fixes #1898
Fixes #1880
Fixes #1293

Fixes wxWidgets#2083, wxWidgets#2081, wxWidgets#1981, wxWidgets#1938, wxWidgets#1901, wxWidgets#1898, wxWidgets#1880, wxWidgets#1293
Runs 10-100x faster while using slightly more memory.
Adds a new style `TR_LIVE_UPDATE` to show column resizing live rather than drawing a preview line.
Bump version from 1.4 to 1.5
memory.DrawLabel(self._text, textrect)

memory.SelectObject(wx.NullBitmap)

# Gtk and Windows unfortunately don't do so well with transparent
# Gtk and Windows unfortunatly don't do so well with transparent
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like you overwrote a bunch of spelling fixes that were made.

@RobinD42
Copy link
Member

This pull request has been mentioned on Discuss wxPython. There might be relevant details there:

https://discuss.wxpython.org/t/customtreecontrol-escaping-edit-node-label-causes-inconsistent-state-on-linux/40200/2

@HelioGuilherme66
Copy link
Contributor

@cbeytas Please review this #2734 . I could not make a PR to your fork because it is three years outdated.

.. versionadded:: 2.8
"""
if not isinstance(text, six.text_type):
if isinstance(text, six.binary_type):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please remove uses of six? We've removed six as a dependency.

Copy link
Contributor

@HelioGuilherme66 HelioGuilherme66 Apr 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@swt2c Are you going to consider this PR, or my replacement?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment