Paragraph styles (vs. inline styles) using GtkTextTag



Hi all,

I'm playing with a GtkTextView to build a little toy editor that uses
tags to define user styles. I'm trying to implement two types of
styles: paragraph and inline styles, which apply to entire paragraphs
and inline text, respectively. (This is basically what Apple's Pages
does with "Paragraph Styles" and "Character Styles.")

Unfortunately, I'm having trouble building paragraph styles. Tags
correspond logically to inline styles; to create paragraph styles, I
initially thought to try to just ensure that a paragraph style tag is
wrapping the entire paragraph, but this is difficult to ensure (say a
user deletes the newlines after the paragraph --- I have to do a lot
of work on each keystroke). It seems like Tags are just very awkward
for this.

So I'm wondering if there's a better approach to creating tags that
apply to an entire paragraph?

I also thought about playing with Clutter text actors, but I'm not
sure if this could buy me anything. I assume I'd have to put
everything in one actor, e.g. for selection to work. Any reason to
pursue this?

Thanks . . .

-- 
Jeff Wheeler

Undergraduate, Electrical Engineering
University of Illinois at Urbana-Champaign



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