Re: GtkSCText (was: Timescale issues)



Derek Simkowiak wrote:

> > This is probably way off target, but why doesn't someone with the time
> > (and inclination) look at the guts of one of the semi-infinite numbers
> > of editors out there and factor out the text engine one which is
> > closest to what is required?
>
>         I've done this.  The problem is that the only parts of these other
> editors that are re-usable are the algorithms (which are fairly
> well-understood already).  Most everything else in the GtkText widget is
> Gtk+ specific.
>
>         For example, it uses a Glib Allocator for memory, the Gdk library
> for drawing to screen (and fonts/colors), a GtkAdjustment widget for
> scrolling, Gtk+ signals for event handling, etc.  This stuff can't just be
> pasted from another editor.
>
> > I sort of like the idea of having access to a text widget which has
> > more than simple display capabilities.  Program controlled editing
> > could be quite nice.
>
>         The new GtkText will have the ability to specify selections (and
> do inserts, etc.), but the syntax highlighting should definately be left
> out of the GtkText widget.

I sort of disagree with this.  (It depends on how you define syntax...)

I feel we need a method for easily highlighting 'invalid' input (like
mispelled text).

I think there should be a method of highlighting text and connecting
a 'clicked' or 'selected' signal to the highlighted text.

>
>
>         Although we will eventually have a sub-class of GtkText that does
> include syntax highlighting, the basic text entry widget should not.
> Another problem with syntax highlighting is that all the Gtk+-based
> implementations I've seen so far use regular expressions for the
> highlighting, which is very, very slow.  Syntax highlighting should be
> done using a customizable lexical scanner.  See Nedit, Code Crusader, or
> (on Win32) TextPad for examples of this.
>
>

I feel the method for determining syntax highlighting should be relegated to
subclasses or aggregated code, but I think the basic mechanism of highlighting
should be in the GtkText widget.


> --Derek

++Kent




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]