Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Tk TableMatrix format part of cell

by Anonymous Monk
on Dec 03, 2018 at 09:30 UTC ( [id://1226650]=note: print w/replies, xml ) Need Help??


in reply to Re: Tk TableMatrix format part of cell
in thread Tk TableMatrix format part of cell

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1226650]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-25 12:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found