Playing around with possibly adding some controls - wx.Slider in this case - to a panel, etc., and wondering if then the .Refresh() method is then meant to render the newly added controls, which are added during/at run-time?
Or should I be caling other re-paint/re-draw methods, or calling them from specific parent objects/elements?
TIA
Jacob Kruger
Blind Biker
Skype: BlindZA
“Roger Wilco wants to welcome you…to the space janitor’s closet…”
Ok, and just after sent that message realised that needed to declare window panel as class variable/object, and specifically use it when instantiating new child elements, as parent=self.panel, and then a .Refresh() seemed to work.
Stay well
Jacob Kruger
Blind Biker
Skype: BlindZA
“Roger Wilco wants to welcome you…to the space janitor’s closet…”
Playing around with possibly adding some controls - wx.Slider in this case - to a panel, etc., and wondering if then the .Refresh() method is then meant to render the newly added controls, which are added during/at run-time?
Or should I be caling other re-paint/re-draw methods, or calling them from specific parent objects/elements?
TIA
Jacob Kruger
Blind Biker
Skype: BlindZA
“Roger Wilco wants to welcome you…to the space janitor’s closet…”
Ok, and just after sent that message realised that needed to declare
window panel as class variable/object, and specifically use it when
instantiating new child elements, as parent=self.panel, and then a
.Refresh() seemed to work.
Most of the time a Refresh will not be needed in that case, because the new widget will be getting a paint even when it is shown and so it will draw itself then. A 2nd paint even from calling Refresh will be redundant. Cases where a Refresh might be needed are when layout is changing a lot or when some widgets may have been overlapping before. Sometimes there can be bits of the widgets at the old positions left on the screen where the system didn't properly handle adding those areas to the update region. A refresh of the parent in those cases will repaint everything and remove the old garbage, but in my experience the occurrence of those situations have been diminishing.
Ok, might try testing this, and reviewing layout position's a bit more when move over to a bit more in depth testing of layout rendidering, etc. - thanks.
Jacob Kruger
Blind Biker
Skype: BlindZA
"Roger Wilco wants to welcome you...to the space janitor's closet..."
···
----- Original Message ----- From: "Robin Dunn" <robin@alldunn.com>
To: <wxpython-users@googlegroups.com>
Sent: Saturday, 19 April, 2014 9:49 PM
Subject: Re: [wxPython-users] .Refresh method?
Jacob Kruger wrote:
Ok, and just after sent that message realised that needed to declare
window panel as class variable/object, and specifically use it when
instantiating new child elements, as parent=self.panel, and then a
.Refresh() seemed to work.
Most of the time a Refresh will not be needed in that case, because the new widget will be getting a paint even when it is shown and so it will draw itself then. A 2nd paint even from calling Refresh will be redundant. Cases where a Refresh might be needed are when layout is changing a lot or when some widgets may have been overlapping before. Sometimes there can be bits of the widgets at the old positions left on the screen where the system didn't properly handle adding those areas to the update region. A refresh of the parent in those cases will repaint everything and remove the old garbage, but in my experience the occurrence of those situations have been diminishing.
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.