question on viewlistbook

Bertrand,

Bertrand Son Kintanar wrote:

    The problem I see is that you recreate the listctrl all the time. I
    changed it to create a listctrl based on the option (i.e. use setattr
    and getattr) and have two functions to work with the listctrl, one a
    LoadListctrl which is used once at startup and then an
    UpdateListrctrl
    which just reloads the data into the already existing listctrl.

Yeah I'm aware of that, since I don't know how to reload the listctrl without recreating it. Your approach really works.

Lucky me :slight_smile: , no serious I had never tried this before as in my app I save a variable for things like a listctrl, so I did learn something by helping you.

If your lists will contain lots of items, hundreds or thousands you should also look into the virtual listctrl (see the wxPython demo).

    You defined the __init__ for wx.App, I don't think you want to do
    this,
    or if you do then you should support all the parameters. I use
    Boa so I
    prefer that exceptions get to Boa which then allows me to just
    click on
    the appropriate line to jump into the source line.

    Werner

:smiley: I guess I need to learn more on how wxPython works.

Don't we all - maybe with the exception of Robin :wink: and a few others (and I am definitely non with those few).

Thanks for the help.

You are welcome and have a nice Sunday
Werner

···

On 8/26/07, *Werner F. Bruhin* <werner.bruhin@free.fr > <mailto:werner.bruhin@free.fr>> wrote: