in my application, I have 4 different classes that handle different
widgets (mostly panels). In 2 of these classes, I have event handlers for
the EVT_PAINT and EVT_SIZE. Knowing that I am porting C++ code to Python,
I hope to have translated correctly everything. In effect, everything seems
to work perfectly, except the Refresh() of my widgets (panels, controls,
windows and so on).
For example, when I click a button, a panel is repositioned to the bottom
of my main frame and it is "collapsed" (hidden, in some way), together with
the controls that belong to this panel. After 2 or 3 clicks (repositioning
and hiding or showing), the main frame background is corrupted (the panel
is somewhat repositioned but its controls are still visible, over other
controls, everything is a mess).
Anyway, if I minimize and then maximize my main frame, everything is perfectly
shown, like my window was completely refreshed. The most ideal solution
would be to minimize/maximize the window at every operation, but I don't
think it would be an option...
Is there a way to obtain a complete refresh without minimize/maximize the
main frame? I have already tried Refresh() and its friends...
in my application, I have 4 different classes that handle different
widgets (mostly panels). In 2 of these classes, I have event handlers for
the EVT_PAINT and EVT_SIZE. Knowing that I am porting C++ code to Python,
I hope to have translated correctly everything. In effect, everything seems
to work perfectly, except the Refresh() of my widgets (panels, controls,
windows and so on).
For example, when I click a button, a panel is repositioned to the bottom
of my main frame and it is "collapsed" (hidden, in some way), together with
the controls that belong to this panel. After 2 or 3 clicks (repositioning
and hiding or showing), the main frame background is corrupted (the panel
is somewhat repositioned but its controls are still visible, over other
controls, everything is a mess).
In general hiding a child window should either restore or refresh what was under it on the parent. Probably what you are seeing is not the controls but just their image being left on the screen. What kind of frame is it? When you say "frame background" what is it? Anything special?
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
In general hiding a child window should either restore or refresh what
was under it on the parent. Probably what you are seeing is not the
controls but just their image being left on the screen. What kind of
frame is it? When you say "frame background" what is it? Anything special?
it is nothing special. As you may remember, I'm trying to convert wxFoldPanelBar
to pure Python/wxPython code. The code is almost finished, it works pretty
well, except the refreshing of the item when the containers of the controls
(which are panels) are repositioned to the bottom of the frame. What I see
is exactly what you said: "Probably what you are seeing is not the controls
but just their image being left on the screen".
I used the wrong words: it is not the FRAME background, I just still see
the image of old controls left on screen, while they should not be there.
If I minimize and then maximize the window, everything is correctly refreshed.
I am not able to post a small example, because (at least for me) the FoldPanelBar
implementation is quite complex (for a newbie like me, obviously ).
If I can not get rid of this situation, I will post the whole code and probably
some kind soul will find what I (as non-expert) missed/did wrong.
BTW, is there something (in general) that I can do to obtain the same effect
of minimize/maximize the window (without effectively do it), in order to
refresh it?
In general hiding a child window should either restore or refresh what
was under it on the parent. Probably what you are seeing is not the controls but just their image being left on the screen. What kind of frame is it? When you say "frame background" what is it? Anything special?
it is nothing special. As you may remember, I'm trying to convert wxFoldPanelBar
to pure Python/wxPython code. The code is almost finished, it works pretty
well, except the refreshing of the item when the containers of the controls
(which are panels) are repositioned to the bottom of the frame. What I see
is exactly what you said: "Probably what you are seeing is not the controls
but just their image being left on the screen".
I used the wrong words: it is not the FRAME background, I just still see
the image of old controls left on screen, while they should not be there.
If I minimize and then maximize the window, everything is correctly refreshed.
I am not able to post a small example, because (at least for me) the FoldPanelBar
implementation is quite complex (for a newbie like me, obviously ).
If I can not get rid of this situation, I will post the whole code and probably
some kind soul will find what I (as non-expert) missed/did wrong.
BTW, is there something (in general) that I can do to obtain the same effect
of minimize/maximize the window (without effectively do it), in order to
refresh it?
Figure out which window the garbage is displayed upon and then call its Refresh method.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!