proper multiple panels/windows/tabs

Hi mailing,

I’m writing an app in wxpython, which basically
has to show 5 different windows and then end the app.

Most tutorials on wxpython only show how to implement
one frame with one app, like this:

Class app

        -call the frame

Class frame

        -some buttons, sizers, panels etc.

Main method

-call app

What I need is an app which shows five different
frames sequentially. Like a windows install wizard, where each frame is
different.

I was wondering, what’s the proper way to do
this?

Do I need to write five frame classes or can I update
my existing frame?

Can I remove the panels inside a frame? If so, how do
I repaint the updated frame?

How does app/frame updating work in general?

Thanks for your input…

Sanne

Sanne Korzec wrote:

Hi mailing,

I’m writing an app in wxpython, which basically has to show 5 different windows and then end the app.

Most tutorials on wxpython only show how to implement one frame with one app, like this:

Class app

-call the frame

Class frame

-some buttons, sizers, panels etc.

Main method

-call app

What I need is an app which shows five different frames sequentially. Like a windows install wizard, where each frame is different.

I was wondering, what’s the proper way to do this?

Do I need to write five frame classes or can I update my existing frame?

Can I remove the panels inside a frame? If so, how do I repaint the updated frame?

How does app/frame updating work in general?

Thanks for your input…

Sanne

Hi Sanne,

You will not need five different frames. You can accomplish your goal by showing and hiding the panels as appropriate. I made a little demo (attached) where you can advance through five panels in the frame. My wxPython is a little rusty but I think it demonstrates the point. Anyone feel free to point out if I have done something improper.

- Mike

test.py (1.16 KB)

Have you looked at wx.animate.AnimationCtrl and Throbber in the demo?

···

On Fri, May 30, 2008 at 1:22 PM, Sanne Korzec <sanne@kortec.nl> wrote:

Hi There,

I'm writing a GUI which shows a picture in a panel. I now want to update the
image from time to time to make a crude animation. However if I do this
within the same event, it doesn't work. This code shows nothing for 1 second
and then only shows the last image.

Any hints would be helpful.

CODE:

       def some_handler(self, event):

       self.bitmap = wx.Bitmap('pics/demo1.jpg')
       wx.EVT_PAINT(self, self.OnPaint)
       self.mainPanel.Layout()

       time.sleep(1)

       self.bitmap = wx.Bitmap('pics/demo2.jpg')
       wx.EVT_PAINT(self, self.OnPaint)
       self.mainPanel.Layout()

       def OnPaint(self,event):

       dc = wx.PaintDC(self)
       dc.DrawBitmap(self.bitmap, 10, 10)