GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Wed Aug 27, 2014 8:50 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Setting (Pango) marked text into gtk_text_view
PostPosted: Tue Nov 28, 2006 10:53 pm 
Offline

Joined: Tue Nov 28, 2006 9:42 pm
Posts: 3
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.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 29, 2006 2:38 am 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 3:07 am
Posts: 384
Location: Fairfax, Virginia
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.

_________________
Andrew Krause

Foundations of GTK+ Development: Buy now for only $31.49!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 29, 2006 3:15 pm 
Offline

Joined: Tue Nov 28, 2006 9:42 pm
Posts: 3
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...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 29, 2006 3:45 pm 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 3:07 am
Posts: 384
Location: Fairfax, Virginia
I would recommend checking out bug #59390: http://bugzilla.gnome.org/show_bug.cgi?id=59390

_________________
Andrew Krause

Foundations of GTK+ Development: Buy now for only $31.49!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group