wxEditor Curiosity

I've got an app that uses

from wxPython.lib.editor import wxEditor

etc, etc, and it generally works pretty good. The wxEditor is a text
editor that takes about 1/3 of the screen. About once in a while,
it kind of goes into spasms of some sort. It happens when I'm typing
near the bottom of the editor, so I think that maybe it has computed
that it needs to add a scroll bar, adds it, then computes that the
scroll bar is not needed, removes it, etc, ad infinitum. The result
is a flickering, flashing, oscillation kind of spasm, which makes the
thing kind of more than unusable. A mouse click in the area of the
vertical scroll bar settles it down and then I can start typing again.

This adds up to no problem for an app for internal use (what I've got
it in right now), but it sort of makes it something that I wouldn't
include in anything to ship to an outside party.

I suppose that I've seen other similar problems of other toolkits, etc,
on my machine. It might be a more frequent problem here because my
machine is set up for large fonts, which may throw the sizing
calculations off a little, but I really don't think that's the whole
of it. The size of text is very hard to calculate -- even for a given
font size, it varies with which font. You have to do this calculation
of whether or not to show a scroll bar with some margin of safety to
prevent this instability as the results are subject to slopping one
way or the other based on things that no one should have to figure
out. If you add a scroll bar when the vertical size exceeds Z, then
you should only take it off when the size drops below Z - delta,
where delta is big enough to prevent these heebee jeebees.

Al

alc@PublicPropertySoftware.com wrote:

I suppose that I've seen other similar problems of other toolkits, etc,
on my machine. It might be a more frequent problem here because my
machine is set up for large fonts, which may throw the sizing calculations off a little, but I really don't think that's the whole
of it. The size of text is very hard to calculate -- even for a given
font size, it varies with which font. You have to do this calculation
of whether or not to show a scroll bar with some margin of safety to
prevent this instability as the results are subject to slopping one
way or the other based on things that no one should have to figure out. If you add a scroll bar when the vertical size exceeds Z, then
you should only take it off when the size drops below Z - delta,
where delta is big enough to prevent these heebee jeebees.

If you can find a fix in the wxEditor code I'll apply a patch, but it may be something in the wxScrolledWindow that just need to have a workaround.

ยทยทยท

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