It works fine for small tables, but my doubt is: if the table grows in size and is dynamically generated, i.e. its rows are continuously created and destroyed, will this have effects on performances or even on stability? Or am I worrying too much?........ The question is if the table becomes to "heavy"/unstable if it grows in size and is frequently changed.
No, you are not worrying too much. An often overlooked problem with Tk problems is memory gain due to the repeated creation and destruction of widgets. Quite often it is discovered too late, and much work has to be discarded as a memory hog, so it is best you watch your memory consumption as you develop any complex Tk script.
First, the only Tk widget that will allow this is the Tk::Canvas, so if you really want this feature, use a Canvas, build your own table of cells, and tag your cell text accordingly.
If you really want to stick with the TableMatrix, your current method of sticking a Text widget in the cell, and using it's tag features is your best shot. I would just caution that you create just one text widget for this purpose and reuse it. This should eliminate any creation/destruction memory gains. See "perldoc -q clear" for how to keep your reusable Text widget free of old data.
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.