http://www.perlmonks.org?node_id=1036289

elef has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks, the title says it all. Is it possible to display text in TableMatrix so that, say, the fifth word is in a pink font or has a yellow background? I remember seeing sample code for doing this in some other Tk widget (probably label or something basic like that) but I can't remember where I saw it and I have no idea if the same approach would work in TableMatrix.
(Background: I plan to use TableMatrix to display the results of a text lookup and I would like to highlight the matched word/expression.)
  • Comment on Varying font settings within a cell in Tk::TableMatrix?

Replies are listed 'Best First'.
Re: Varying font settings within a cell in Tk::TableMatrix?
by elef (Friar) on Jun 02, 2013 at 07:23 UTC
    No comment from anyone?
    One solution I thought of is to put Label widgets in every cell, which TableMatrix supports out of the box. Then if I can find the code for putting mixed fonts in labels, I'm all set. It would probably be simpler and more efficient to do this within TableMatrix, of course.

      No comment from anyone?

      <Nelson Muntz>Ha-ha!</Nelson Muntz>

      It would probably be simpler and more efficient to do this withing TableMatrix, of course.

      The docs don't show that its possible, although it might be :) its not

      So stick a Tk::Text into a cell and there you go, $table->get('row,col') then tagAdd/tagConfigure ... in theory

      Or patch/extend Tk-TableMatrix-1.23\pTk\tkTableTag.c and ... c-fudge :)