SetStyle moving scroll position

13 views
Skip to first unread message

mikPyVS

unread,
Jan 6, 2009, 12:50:25 AM1/6/09
to wxPython
Hello, I'm running a syntax highlighter in an onIdle event and when I
call SetStyle I get flashing in the TextCtrl and if the user has used
the scroll bar to move through the code SetStyle moves the visible
area back to the setinsertionpoint (not where I updated but to where
the cursor was).- I'm not running this in a thread (but have tried
with no benefit)
<code>

self.fmtObj.Freeze()

self.fmtObj.SetStyle(line[0], line[1], wx.TextAttr
(fcolor,bcolor, f))

self.fmtObj.Thaw()
</code>

2 questions.
*Is the refreshing expected?
*Is there a way to prevent the scroll position from being reset?- I've
tried resetting the scroll position directly but this gets the virtual
view and view offset- scroll pos no longer points to correct location
in file.

Thanks

Mike Driscoll

unread,
Jan 6, 2009, 11:34:12 AM1/6/09
to wxPython
Hi,
Normally, Freeze and Thaw are used to modify the GUI without causing
flicker. If you are seeing flicker, than it's not working right. If
you're not seeing the update after the Thaw, then you may need a call
to the panel or frame's Refresh() method.

By the way, I recommend the official wxPython mailing list over this
one. There are many experienced users on it including some of the core
developers and you can learn a lot there just be lurking. Here's a
link:

http://wxpython.org/maillist.php

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org
Python Extension Building Network: http://www.pythonlibrary.org

mikPyVS

unread,
Jan 6, 2009, 1:08:02 PM1/6/09
to wxPython
I'm seeing the edit but the thaw resets the visible pane to the where
the insertion point is. So if the user scrolls to another section the
view is reset to the insertion point when the Thaw is called- I'll
check out the official mailing list- thanks.
Reply all
Reply to author
Forward
0 new messages