wxStyledTextCtrl Problem
···
------------------------
I am running
Redhat Linux 6.2.
wxGTK 2.2.2
wxPython 2.2.2
Python 2.0
I am experiencing a problem with the wxStyledTextControl. The behaviour
is sluggish
and it uses up a lot of CPU.
My Research
------------
I placed a printf into stc.cpp, in the OnPaint() method. This printf
displays the rectangle co-ordinates. I see that the OnPaint method is
called
each time the cursor blinks.
I notice that the call is made even when the cursor is not blinking,
i.e.
where the cursor is on another screen (Small problem).
You can see the cursor behavior by placing these lines in OnPrint..
wxRect rect = region.GetBox();
printf("stc.cpp:wxStyledTextCtrl::Painted(%d, %d, %d, %d\n",
rect.x, rect.y, rect.width, rect.height);
If you run the demo program, you can see the paints ...
python2.0 run.py wxStyledTextCtrl_2.py
O.K. So far.
Problematic Behaviour
---------------------
I place my wxStyledTextControl on a notebook. There is a wxPanel between
the
wxStyledTextControl, because I found that this helps. Occasionally, when
I
scrolldown using the scrollbar, the cursor region height gets totally
messed
up. It becomes some number > 60000. (possibly some short underflow ??)
The resulting refreshes are extremely time consuming.
stc.cpp:(1513)::wxStyledTextCtrl::Painted(40, 0, 579, 65168
stc.cpp:(1513)::wxStyledTextCtrl::Painted(0, 0, 619, 404
stc.cpp:(1513)::wxStyledTextCtrl::Painted(40, 0, 579, 64784
stc.cpp:(1513)::wxStyledTextCtrl::Painted(40, 0, 579, 64784
I am not sufficiently familiar with wxWindows to identify the source of
these
events. Perhaps someone could give me a few pointer as to where to look
(and
perhaps how).
I can defend against the problem by placing the following code in
the OnPaint method. (However, I would like to identify the source of the
problem.)
wxRect rect = region.GetBox();
if (rect.height > 60000)
rect.height=16;
Thanks in advance
Kevin
_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users