[wxPython-users] Re: update Choice values at runtime

Patrick K. O'Brien pobrien at orbtech.com
Tue Nov 13 14:51:07 PST 2007


On Nov 13, 2007, at 4:27 PM, Stefan Pampel wrote:

> I found an other solution that solves my issue
>
> 	output_formats = [ 'a', 'b', 'c'] #the list came from an cli output
>         output_formats.reverse()
>         for i in output_formats:
>             self.output_format_choice.Insert(i, 0)

That's really inefficient.  Instead of reverse() and Insert(), try  
Append().  And if you have all your items up front, use SetItems()  
which will be much faster than entering one at a time in a loop.   
There's also AppendItems().  :-)

-- 
Patrick K. O'Brien
Orbtech    http://www.orbtech.com
Schevo     http://www.schevo.org






More information about the wxpython-users mailing list