 |
GTK+ Forums Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
|
|
|
| Author |
Message |
|
|
blakemadden
Joined: 28 Nov 2006 Posts: 3
|
Posted: Tue Nov 28, 2006 10:53 pm Post subject: Setting (Pango) marked text into gtk_text_view |
|
|
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
|
Posted: Wed Nov 29, 2006 2:38 am Post subject: |
|
|
| 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
|
Posted: Wed Nov 29, 2006 3:15 pm Post subject: |
|
|
| 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
|
|
| Back to top |
|
 |
|
Powered by phpBB © 2001, 2005 phpBB Group CodeBB 1.0 Beta 2
|