On 3/5/07, Josiah Carlson <[EMAIL PROTECTED]> wrote:
On 3/4/07, SPE Stani's Python Editor <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I have written a prototype of the 'fold explorer'. It is quite
> wonderful as there is no python specific code in it: everything is
> generic. Even to keep to lexing coloring scheme unbiased, I throw in a
> picasso lexer which colours the code by inspiration of the moment. So
> everytime you start the prototype you will get another color scheme.
> It is not useful, but this saves me of writing down colour schemes for
> all the 78 languages Scintilla supports.
>
Very Nifty.
On Windows (though it should also work on *nix), you need to replace...
self.CollapseAndReset(self.root)
with:
self.DeleteChildren(self.root)
Thanks, it also works on Ubuntu.
Also, on Windows, until the last bit of the file has actually been seen, it
doesn't actually know the fold levels all the way there. Even waiting a few
seconds doesn't actually get the latter portion of the file lexed. I've
found that by replacing the two wx.CallAfter methods in .open and .setText
with a pair of wx.FutureCalls seems to work ok. A single wx.FutureCall that
forces the explorer.update, then scrolls back to the first line would
probably be better.
Before I had this:
def setText(self,text):
self.SetText(text)
step = self.LinesOnScreen()
n = self.GetLineCount()
for line in range(0,n,step):
self.GotoLine(line) #make sure everything is lexed
wx.CallAfter(self.explorer.update)
But just going to the last line is fine on Linux. Another option would
be to open a file on the last line. Can you check if that works? But
of course it is not elegant.
Then again, it would be much better if we could get a message from the
underlying control when it finished lexing, and/or had the ability to ask it
to lex the whole file (and tell us when it was done).
Yes, I agree totally but I didn't find any reference how that could be
provoked. Maybe a question for Neil.
Stani
--
http://pythonide.stani.be
http://pythonide.stani.be/screenshots
http://pythonide.stani.be/manual/html/manual.html