Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Tk TableMatrix format part of cell

by Aldebaran (Curate)
on Dec 03, 2018 at 00:39 UTC ( [id://1226645]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-19 19:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found