On Sun, 2005-08-21 at 23:40 +0200, Jeroen Zwartepoorte wrote: > On 8/21/05, Havoc Pennington <[EMAIL PROTECTED]> wrote: > > Also basic support for "styled editing," i.e. right now to implement a > > Bold button that behaves like the one in a word processor is fairly > > involved with GtkTextView. So some kind of API for that might be cool. > > What kind of API are you thinking about here? > > Imho, the current API isn't that difficult to use. Maybe we just need > to advertise/provide some more examples on how to use it: > > 1. create a new GtkTextTag: gtk_text_tag_new ("bold"); > 2. set the bold attribute: g_object_set (tag, "weight", > PANGO_WEIGHT_BOLD, NULL); > 3. get a start & end iter for the text you want to apply the tag to > 4. call gtk_text_buffer_apply_tag_by_name >
That isn't good enough though; there are a bunch of detailed behaviors that are expected if you have a normal word-processor-style toolbar with text styles. I don't remember all of them but for example when you select text and choose a style it should apply to the selection, when you have an empty buffer things need to work, I think some other stuff. I remember spending a lot of time on it. Havoc _______________________________________________ desktop-devel-list mailing list desktop-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/desktop-devel-list