Re: advice on implementing "elastic tabstops" for GTK+ 2.x?
- From: Owen Taylor <otaylor redhat com>
- To: Nick Gravgaard <me nickgravgaard com>
- Cc: gtk-devel-list gnome org
- Subject: Re: advice on implementing "elastic tabstops" for GTK+ 2.x?
- Date: Sun, 15 Oct 2006 15:01:21 -0400
On Sun, 2006-10-15 at 18:07 +0200, Nick Gravgaard wrote:
> Hi all,
>
> I would like to implement an idea I call "elastic tabstops" (see
> nickgravgaard.com/elastictabstops/) for GTK+ 2.x. Could someone advise
> me on whether support for this should be added to an exisiting widget
> (GtkTextView?), or if another approach should be used?
Because the effect is non-local - the contents of one paragraph effect
the drawing (and line wrapping?) of previous/following paragraphs, you'd
certainly have to change the GtkTextView code to make GtkTextView show
that effect. A GtkTextView uses a PangoLayout per paragraph.
(Nobody uses GtkTextView for editing source code directly, but the
GtkSourceView subclass is used for that extensively. That's a separate
project from GTK+.)
If you also wanted to get the effect for multi-line GtkLabels then you'd
have to also implement support for it inside Pango, since a GtkLabel
uses a single PangoLayout with multiple paragraphs in it.
GtkTextView and GtkLabel are the only GTK+ widgets that show multiple
lines of text.
For both GtkTextView and PangoLayout I think you'd find the job a bit
challenging. (Think days or weeks, not hours.) There is a lot of
existing complexity in both of them you'd have to integrate with. But
possible? I don't see why not.
- Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]