[wxPython] win32 wxTreeCtrl SortChildren() bug?

How are you adding items to the tree?

···

-----Original Message-----
From: Alessandro Iob [mailto:alexiob@iname.com]
Sent: Monday, September 24, 2001 2:24 PM
To: wxpython-users@lists.wxwindows.org
Subject: [wxPython] win32 wxTreeCtrl SortChildren() bug?

I've a wxTreeCtrl sorted at root with SortChildren () method. On
linux/gtk it works, on Windows (in my case windows 2000) not.
It does not work neither as a direct wxTreeCtrl nor as a derived class
as the following:

class SortedTree (wxTreeCtrl):
  def __init__ (self, parent, id, pos=wxDefaultPosition, size =
wxDefaultSize, style = wxTR_HAS_BUTTONS, validator = wxDefaultValidator,
name = "listCtrl"):
    wxTreeCtrl.__init__ (self, parent, id, pos, size, style)

  def OnCompareItems (self, item1, item2):
    #t1 = self.GetPyData (item1)
    #t2 = self.GetPyData (item2)
    t1 = self.GetItemText (item1)
    t2 = self.GetItemText (item2)
    print 'compare: ' , item1,t1 , ' <> ' , item2,t2
    r = None
    if t1 < t2: r = -1
    if t1 == t2: r = 0
    else: r = 1
    return r

It has t1,t2 values always set to 'None' in both cases above
(un/commented ones), but
item1,item2 are correct "<C wxTreeItemId instance at
_bfffe068_wxTreeItemId_p>".
I set items data at init time with tree.SetPyData (item, ('a','tuple')).

Any suggestions?

Thanks

Alex

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users