[wxpython-users] Adding same item to sizers

Robin Dunn robin at alldunn.com
Wed May 14 15:24:20 PDT 2008


Arthur Valadares wrote:
> Hi everyone, I'm trying to do a demo of an interface, so I was thinking 
> of using using the same objects many times to show the impression of a 
> page filled with objects, but i keep getting the message that I can't 
> add the same item twice to a sizer. Is there any way I can add a same 
> item more times to a sizer? If not, how can I make a simple copy of the 
> item, so i don't have to recreate it? i tried copy.deepcopy(item) with 
> no success (error from the copy library)

You have to create new instances of it.  Putting an item in a sizer 
multiple times makes no sense because a single widget can not be located 
in more than one position at a time.  The copy module fails for a few 
reasons, the main one being that it has no knowledge of the internal C++ 
guts of the widget.


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



More information about the wxpython-users mailing list