wxComboBox/wxChoice bad flickering

Hello, I'm extending the HtmlWindow with some custom tags that create some of
the standard wxPython widgets inside the html page.
I had no problems with buttons or text controls, but I have bad problems with
wxComboBox (in read only mode, almost like a wxChoice) and wxChoice. If I put
one of those control inside the page the program is blocked and it goes on
redrawing the control for ever. All of the UI is blocked, even the close button.
If I click the close button on the window title bar, the command has no effect
if I do not click on the wxChoice/wxComboBox.
After some investigation I found that the control goes on receiving size
events. If I catch those events and block them, I can see that the the control
receives three size messages (I create the control with size=(-1,-1))
One is (I think) the standard size, the second is the size calculated by the
html renderer (actually I use the float=100 option) and then the third attempts
to resize the control on the vertical axis, making it much taller. Much more
than the size necessary to accomodate all of the options I enter. Furthermore,
blocking events in this way I obtain a big white rectangle surrounding my
control! The rectangle intercepts clicks, it covers other controls on the window
and does not pass the clicks to them even if it is not using the click.

The platform is Windows 2000, python 2.3 and the latest wxPython distro.

Any help or inisght would be appreciated.

Thanks,
Riccardo

rtrocca@libero.it wrote:

Hello, I'm extending the HtmlWindow with some custom tags that create some of
the standard wxPython widgets inside the html page. I had no problems with buttons or text controls, but I have bad problems with
wxComboBox (in read only mode, almost like a wxChoice) and wxChoice. If I put
one of those control inside the page the program is blocked and it goes on
redrawing the control for ever. All of the UI is blocked, even the close button.
If I click the close button on the window title bar, the command has no effect
if I do not click on the wxChoice/wxComboBox.
After some investigation I found that the control goes on receiving size
events. If I catch those events and block them, I can see that the the control
receives three size messages (I create the control with size=(-1,-1))
One is (I think) the standard size, the second is the size calculated by the
html renderer (actually I use the float=100 option) and then the third attempts
to resize the control on the vertical axis, making it much taller. Much more
than the size necessary to accomodate all of the options I enter. Furthermore,
blocking events in this way I obtain a big white rectangle surrounding my
control! The rectangle intercepts clicks, it covers other controls on the window
and does not pass the clicks to them even if it is not using the click.

I've seen this before and wasn't able to figure it out. I think Vaclav looked at it too with no success.

The workaround is to put the control on a wxPanel, and put the panel in the wxHtmlWindow.

ยทยทยท

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