From: Kevin A. <al...@se...> - 2004-04-27 19:36:08
|
On Apr 27, 2004, at 11:16 AM, Kevin Altis wrote: > Calling Refresh and Update is safest because it forces the whole > control to > be redrawn. The StaticText component actually contains an explicit > Refresh() > call as part of its _setText method but I'm considering removing that. > The > original idea was that StaticText is more likely to be used for the > kind of > status messages you are doing above, so it would be nice to have it > automatically do the right thing. Of course, it really needs to call > Update > as well for it to always work on all platforms, so I'll add that until > a > decision is made on whether to drop automatic Refresh/Update in the > future. > I went ahead and added a redraw() method to Widget, so starting with release 0.8 it will be easy to force an immediate update with any component. def redraw(self): """Force an immediate redraw without waiting for an event handler to finish.""" self.Refresh() self.Update() Note that this isn't required for BitmapCanvas since it refreshes automatically as part of the blit from the offscreen bitmap after each draw operation and has its own autoRefresh attribute to avoid blits after each draw operation if you're doing a lot of draw operations at once and want finer control over when to update the screen. ka |