I've replaced calls to Append() with Insert(textItem, Listbox.Count)-
which gives me the behavior I expected with Append.
On Thu, Dec 17, 2009 at 2:27 PM, cappy2112 <capp...@gmail.com> wrote:
>
> Is it normal for the behavior of ListBox.Append() to add an item to
> the beginning of the list instead of the end?
No, not unless the listbox is empty then the end is also the beginning
> Is this not more of a prepend operation?
>
> I've replaced calls to Append() with Insert(textItem, Listbox.Count)-
> which gives me the behavior I expected with Append.
Append should add it to the end and it does on my machine.
What OS, version of wxPython, and architecture (32/64 bit) are you using?
Cody
> What OS, version of wxPython, and architecture (32/64 bit) are you using?
XP, SP2. '2.8.9.1 (msw-ansi)', 32-bit. We use Python 2.3- so I can't
go to any newer versions of wx because there are no binaries for 2.3
after this version of wx.
I also see this behavior on my laptop, which is running Windows 7, 32-
bit, probably a lot more recent version of wxPython, because I am
using Python 2.5 on the laptop.
On Thu, Dec 17, 2009 at 2:41 PM, cappy2112 <capp...@gmail.com> wrote:
> XP, SP2. '2.8.9.1 (msw-ansi)', 32-bit. We use Python 2.3- so I can't
> go to any newer versions of wx because there are no binaries for 2.3
> after this version of wx.
>
> I also see this behavior on my laptop, which is running Windows 7, 32-
> bit, probably a lot more recent version of wxPython, because I am
> using Python 2.5 on the laptop.
On my windows xp box py2.5.4 wx2.10.1 this behavior is not
reproducible, so not sure what else I can tell you.
See attached test app.
Cody
Actually one thing did come to mind, are you using any style flags on
your listbox?
Using LB_SORT would modify the behavior of how things are added to the
list by Append and could explain what your seeing
Cody
Yes, but not the sort style.
I am using these
wx.TE_READONLY|wx.LB_HSCROLL|wx.LB_MULTIPLE
TE_READONLY is a TextCtrl style flag so you shouldnt use it with a list box
and by coincidence look at this
>>>import wx
>>>wx.TE_READONLY
16
>>>wx.LB_SORT
16
Cody
> TE_READONLY is a TextCtrl style flag so you shouldnt use it with a list box
> and by coincidence look at this
That explains it all. I had originally used a TextCtrl then switched
to a ListBox without changing all of the style options.
Thanks