Hello list,
I am using a HyperTreeList (from wx.lib.agw) on Ubuntu, and the SetItemWindow function is not working as expected.
I might be doing something wrong, so below is a simplified piece of code that reproduces the “error”.
import wx
import wx.lib.agw.hypertreelist as tl
class MyApp(wx.App):
def __init__(self):
wx.App.__init__(self)
self.mainWindow = wx.Frame(None, title='HyperTreeList Test')
self.recaps = tl.HyperTreeList(self.mainWindow, wx.ID_ANY, wx.DefaultPosition, (-1, -1), agwStyle=wx.TR_HIDE_ROOT)
self.recaps.AddColumn('Name')
self.recaps.AddColumn('Age')
self.recaps.SetColumnAlignment(self.recaps.GetColumnCount()-1, wx.ALIGN_RIGHT)
root = self.recaps.AddRoot('')
col1Text = wx.StaticText(self.recaps.GetMainWindow(), -1, '15', style=wx.ALIGN_RIGHT)
root = self.recaps.GetRootItem()
item = self.recaps.AppendItem(root, 'Ann')
self.recaps.SetItemWindow(item, col1Text, column=1)
def run(self):
self.SetTopWindow(self.mainWindow)
self.mainWindow.Show()
self.MainLoop()
``
As you can see on the attached image, the StaticText is not inserted in column 1 as requested
But if I change to
self.recaps.SetItemWindow(item, col1Text, column=0)
``
It is well inserted in column 0
Any help will be appreciated
Thanks in advance
Dorice