in reply to Tk TableMatrix format part of cell

Do you have a self-contained example of what works now and where in the code you would like to add this new feature?

Replies are listed 'Best First'.
Re^2: Tk TableMatrix format part of cell
by Anonymous Monk on Dec 03, 2018 at 09:30 UTC

    Here it is a basic one. I want to apply my formatting only to the string "world"

    #!/usr/bin/perl use strict; use warnings; use Tk; use Tk::TableMatrix; my $ArrayWidget; my $mw = new MainWindow(); my $FontBold = $mw->Font( -weight => 'bold'); my ($rows,$cols) = (50, 4); foreach my $row (0..$rows){ $ArrayWidget->{"$row,0"} = "$row"; } foreach my $col (0..$cols){ $ArrayWidget->{"0,$col"} = "$col"; } my $table = $mw->Scrolled('TableMatrix', -state=>'disabled', -rows => $rows, -cols => $cols, -colwidth => 20, -height => 6, -titlerows => 1, -titlecols => 1, -variable => $ArrayWidget, -wrap=>1, -multiline=>1, -scrollbars => 'osoe', -relief => 'flat', -selecttitles => 0, -highlightthickness=>0 )->pack(); $table->tagConfigure ("bold", -bg => "#689bc0"); $ArrayWidget->{"2,2"} = "Hello world"; #Apply tag bold or different font to the string "world", i.e. not to t +he entire cell 2.2 MainLoop();

    In the mean time I came to the conclusion that this feature is not supported and that I need to insert in any cell another Widget supporting formatting. The question is if the table becomes to "heavy"/unstable if it grows in size and is frequently changed.