diff --git a/wx/lib/agw/customtreectrl.py b/wx/lib/agw/customtreectrl.py index 81c48c45..d10a0182 100644 --- a/wx/lib/agw/customtreectrl.py +++ b/wx/lib/agw/customtreectrl.py @@ -6824,10 +6824,11 @@ class CustomTreeCtrl(wx.ScrolledWindow): # Rightmost alignment of windows wndx = w - item.GetWindowSize().x - 2 + xa + if wnd.GetPosition() != (wndx, ya): + wnd.Move(wndx, ya, flags=wx.SIZE_ALLOW_MINUS_ONE) + # Force window visible after any position changes were made. if not wnd.IsShown(): wnd.Show() - if wnd.GetPosition() != (wndx, ya): - wnd.SetPosition((wndx, ya)) if separator: oldPen = dc.GetPen() diff --git a/wx/lib/agw/hypertreelist.py b/wx/lib/agw/hypertreelist.py index f96fca98..6adaf4ad 100644 --- a/wx/lib/agw/hypertreelist.py +++ b/wx/lib/agw/hypertreelist.py @@ -3052,10 +3052,11 @@ class TreeListMainWindow(CustomTreeCtrl): if item.GetHeight() > item.GetWindowSize(i)[1]: ya += (item.GetHeight() - item.GetWindowSize(i)[1])//2 + if wnd.GetPosition() != (wndx, ya): + wnd.Move(wndx, ya, flags=wx.SIZE_ALLOW_MINUS_ONE) + # Force window visible after any position changes were made. if not wnd.IsShown(): wnd.Show() - if wnd.GetPosition() != (wndx, ya): - wnd.SetPosition((wndx, ya)) x_colstart += col_w dc.DestroyClippingRegion()