We don't bite newbies here... much | |
PerlMonks |
Re: Tk TableMatrix format part of cellby zentara (Archbishop) |
on Dec 03, 2018 at 14:25 UTC ( [id://1226662]=note: print w/replies, xml ) | Need Help?? |
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. I'm not really a human, but I play one on earth. ..... an animated JAPH
In Section
Seekers of Perl Wisdom
|
|