|
From: Kevin A. <al...@se...> - 2002-01-02 20:55:49
|
Argh, it is going to be one of those days. Laggy email and accidentally
hitting send before finishing a message....
Ignore the original code, it was bad. This is checked into cvs.
if used or (not self.hideUnused.GetValue()):
if self.msgHistory.GetLastPosition() > 29000:
self.msgHistory.Freeze()
# delete many lines at once to reduce overhead
text = self.msgHistory.GetValue()
self.msgHistory.SetValue(text[text.index('\n', 3000) + 1:])
self.msgHistory.AppendText(eventText)
self.msgHistory.Thaw()
else:
self.msgHistory.AppendText(eventText)
ka
> -----Original Message-----
> From: pyt...@li...
> [mailto:pyt...@li...]On Behalf Of Kevin
> Altis
> Sent: Wednesday, January 02, 2002 12:02 PM
> To: pyt...@li...
> Subject: RE: [Pythoncard-users] Message Watcher fix
>
>
> > From: Cliff Wells
> >
> > It seems to work okay, up until the point that it tries to
> delete the old
> > messages, then the message window scrolls wildly up and down for a while
> > (it seems that maybe deleting the first message causes a scroll
> to the top
> > of the list, then it scrolls back to the end, then back to the top,
> > etc...). Is there a way to lock the list until the deletes are done?
>
> Okay, let's try some new wxWindows methods, Freeze and Thaw and
> see if they
> help.
>
> if used or (not self.hideUnused.GetValue()):
> self.msgHistory.Freeze()
> while self.msgHistory.GetLastPosition() > 29000:
> # delete first line of history
> self.msgHistory.Remove(0, self.msgHistory.XYToPosition(0,
> 1))
> self.msgHistory.Thaw()
> self.msgHistory.AppendText(eventText)
>
> > It doesn't seem to mangle the first message though =)
>
> Bonus
>
> ka
>
>
> _______________________________________________
> Pythoncard-users mailing list
> Pyt...@li...
> https://lists.sourceforge.net/lists/listinfo/pythoncard-users
>
|