ActiveX_IEHtmlWindow resize problem

Somehow I completely missed your reply. I swear I tried that before, but I
think I called the Fit() method on the panel instead of the Layout()
method. Anyway, you are quite right. It works beautifully. Hopefully my
brain will function better in the future.

Mike

···

-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Friday, September 14, 2007 6:50 PM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] ActiveX_IEHtmlWindow resize problem

Mike Driscoll wrote:
> Hi,
>
> I must be doing something really dumb with this
ActiveX_IEHtmlWindow
> control. I want to embed it in my program, but when I do, I
find that
> it won't resize correctly. The frame resizes fine, but the
> ActiveX_IEHtmlWindow only stays at some default size and doesn't
> redraw itself or something. I've included a sample of what
I am doing.

The problem is that you are making a panel as the child of
the frame, and the notebook as the child of the panel (so far
so good) but you are putting the notebook in the sizer and
assigning the sizer to the frame.
  So it is trying to manage the layout of the notebook as if
it is the child of the frame, but it is not. The notebook is
being clipped by the panel, and there is nothing in your code
to change its size to match the frame.

Simply changing:

         self.frame.SetSizer(mainSizer)
         mainSizer.Fit(self.frame)

to:

         self.panel.SetSizer(mainSizer)
         self.panel.Layout()

takes care of the problem. This makes the frame have no
sizer and so it will fall back to its built-in functionality
of resizing its only child (the panel) to fill the client area.

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