[wxPython] Re: wxpython- THANKS

Hello Robin,
Thank you very much for help.It works.

Does wxPython support animated gif pictures?
Thank you for reply.
Ladislav

···

On 3 Oct 2001, at 6:49, wxpython-users-request@lists.wxwindows.or wrote:

Message: 10
From: "Robin Dunn" <robin@alldunn.com>
To: <wxpython-users@lists.wxwindows.org>
Subject: Re: [wxPython] How to delete items from ListBox
Date: Tue, 2 Oct 2001 18:57:29 -0700
Reply-To: wxpython-users@lists.wxwindows.org

> How can I delete items from this ListBox?
> I tried the following code but without any success.
>
>
> if (self.lb2.GetSelections()!=-1):
> for index2 in self.lb2.GetSelections():
> self.lb2.Delete((index2))
>
>
> That works only if I choose one item at a time only- If I make a
> multiple selection I receive an ivalid index in ListBox::Delete error.

Probably because the indexes are changing when you delete items. If one
of
your selected items was closer to the end than the number of items
deleted
then it will be an invalid index by the time you get to it. Maybe
something
like this:

        selections = list(self.lb2.GetSelections())
        selections.reverse()
        for index in selections:
            self.lb2.Delete(index)

--
Robin Dunn

Does wxPython support animated gif pictures?

Not yet.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!