Wizard/panel questions...

A.M. cuberootva at gmail.com
Thu Jun 22 07:57:16 PDT 2006


Hi all,

I am writing a custom wizard-style app but I am stuck on an issue I am
having. Here is a basic scenario for my problem:

The first page of the wizard (after calling wx.PyWizardPage.__init__)
calls the following method:

def initWindow(self):
   self.DestroyChildren()
   self._sizer = wx.BoxSizer(wx.VERTICAL)
   self.SetSizer(self._sizer)

   self._title = wx.StaticText(self, -1, self._titleCaption)
   self._sizer.Add(self._title, flag=wx.CENTRE)
   self._sizer.Add((0,5))
   self._sizer.Add(wx.StaticLine(self, -1), flag=wx.EXPAND)
   self._sizer.Add((0,20))


Next I have a function binded to a EVT_CHAR event that does nothing
more than add a wxTextCtrl each time the letter "A" is pressed. This
works fine and after a few keystrokes I get something that looks like
this:

                   my title goes here
--------------------------------------------------------------
[ text control                                           ]
[ text control                                           ]
[ text control                                           ]
[ text control                                           ]

Now then, say I want to reset this page (or panel) to look like it
first started. I binded the letter "E" to call the above initWindow
again assuming that it would destroy everything and start from
scratch. It seems to do just that but the positioning is way off. It
resembles something like:

es here

And that's about it. No line or anything. If I hit the "A" key at this
point I can sort of see a VERY small portion (maybe 2px or so) of the
TextCtrl being rendered on the left side of the panel. The funny part
is I can click Next to move to the next page and then click back to
return and everything is rendered fine again! Note: this only happens
in Linux...in Windows the positioning is still screwed up. This led me
to believe it was a repaint issued but I have tried different
combinations of Update, Refresh, Layout, and RecalcSizes.

Any thoughts, ideas, suggestions?

Thanks,

Abe




More information about the wxpython-users mailing list