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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.