[wxPython-users] Reusing panels from dialogs

Frank Aune Frank.Aune at broadpark.no
Fri Feb 22 14:46:48 PST 2008


On Friday 22 February 2008 23:04:15 Robin Dunn wrote:
> Frank Aune wrote:
> > Hi,
> >
> > Please see attached code.
> >
> > In my quest for re-usification (heh!) of code, I'm trying to re-use a
> > panel from inside a dialog in a wizard. The dialog is defined in an XRC.
> >
> > The panel definately takes up realestate inside the wizard, however it
> > never shows the content of the panel. I'm guessing this is related to
> > calling ShowModal() on dialogs before they are visible - so basically: Is
> > there a way to accomplish this, besides moving the panel outside of the
> > dialog in the XRC?
>
> When you load the dialog the panel is created as a child of the dialog.
>   If you want it to appear on the wizard then you need to Reparent() it.
>   However I think it would work out much better if you just make the
> panel be another top-level item in the XRC file.  Then you can load it
> independently, and you can also use a reference in the XRC to use it in
> the dialog too.


Thanks, didn't know about the Reparent() method. 

In the same example, how do I get each page to resize to the smallest possible 
size? Now Im calling self.wizard.GetPageAreaSizer().Add(self.page1), and this 
one accommondate the size of the entire wizard after the biggest page in the 
sequence.

Thanks,
Frank




More information about the wxpython-users mailing list