Hello Monks,
I'm doing a "Help Topics" type menu in my Gtk2 script... I created a plain text file containing all the help data I wanted to include.
But after reading all the documentation I could find for applying "TextTags" to text data to create rich formatted text, it seems to be
somewhat complicated and "wordy"
(*if that makes sense)...
By having to do the following to just create, say a bold Title, seems like a bit much... And since my "Help" txt file has about 120 lines
this looks like it will get a bit bloated after a bit.
# Already created: Window, ScrolledWindow, TextView, TextBuffer, etc..
# Create a Large Bold Title for the TextView using a tag:
$buffer->create_tag(
"main-heading",
weight => "900",
size => 15 * PANGO_SCALE
);
$help_buffer->insert_with_tags_by_name($iter, "\t\t$Program_Name\n\n",
+ "main-heading");
So I was thinking to have to do the above for every few lines when the type of 'style' changes seems overly "wordy" and might take up more
lines then the actual text file itself. The Text File is somewhat like a Multi-Level Bulleted list with new headings every so often, and italic
text for comments, etc...
Does anyone know if this is possible for me to do inside a TXT file and have it displayed in a TextView widget which would include the Marked-up text..?
If anyone any can help with this, that would be great...
I'm really hoping to avoid having to use LOTS of
"insert_with_tags_by_name()" Function calls.
Thanks in Advance,
Matt