GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Setting (Pango) marked text into gtk_text_view

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
blakemadden



Joined: 28 Nov 2006
Posts: 3

PostPosted: Tue Nov 28, 2006 10:53 pm    Post subject: Setting (Pango) marked text into gtk_text_view Reply with quote

With a GtkLabel you can directly add marked up Text (using Pango syntax) using gtk_label_set_markup (with a single function call). However, no functionality seems to exist for a GtkTextView. Is there really no way to just drop a marked up string right into a GtkTextView?

gtk_text_buffer_insert_with_tags isn't really the same thing because you have to create all of the tags and pass them one by one into this function. If you have pages worth of text with a lot of formatting in it, then passing in a Pango formatted string is the only way to go. You can do this with a label, but not a text view?

Thanks.
Back to top
openldev
Never Seen the Sunlight


Joined: 21 Sep 2005
Posts: 387
Location: Fairfax, Virginia

PostPosted: Wed Nov 29, 2006 2:38 am    Post subject: Reply with quote

Yes, unfortunately, there is no simple way to do this with a GtkTextView. However, when you start automating formatting in larger applications, it really does make sense to use the GtkTextTag system.
Back to top
blakemadden



Joined: 28 Nov 2006
Posts: 3

PostPosted: Wed Nov 29, 2006 3:15 pm    Post subject: Reply with quote

openldev wrote:
Yes, unfortunately, there is no simple way to do this with a GtkTextView. However, when you start automating formatting in larger applications, it really does make sense to use the GtkTextTag system.


Not really. Most systems generate formatted text separate from the GUI code (performance being a big part of it). MS's RichEditCtrl allows you to easily drop preformatted RTF text right into it, so this seems like a major oversight in the GTK API. Why can you do this with a label but not a text view-which one of the two more often has formatted text in it? Oh well...
Back to top
openldev
Never Seen the Sunlight


Joined: 21 Sep 2005
Posts: 387
Location: Fairfax, Virginia

PostPosted: Wed Nov 29, 2006 3:45 pm    Post subject: Reply with quote

I would recommend checking out bug #59390: http://bugzilla.gnome.org/show_bug.cgi?id=59390
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP