Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Tk Tablematrix configure word in a cell

by stefbv (Chaplain)
on May 06, 2012 at 09:03 UTC ( #969128=note: print w/ replies, xml ) Need Help??


in reply to Tk Tablematrix configure word in a cell

That was pretty easy in a text widget.

Then try to embed a Text widget in the cell.

Update: A quick demo:

use strict; use warnings; use Tk; use Tk::TableMatrix; my $top = MainWindow->new; my $arrayVar = {}; foreach my $row ( 0 .. 7 ) { foreach my $col ( 0 .. 3 ) { $arrayVar->{"$row,$col"} = "r$row,c$col"; } } my $tmx = $top->Scrolled( 'TableMatrix', -rows => 7, -cols => 3, -variable => $arrayVar, -resizeborders => 'both', -titlerows => 1, -bg => 'white', ); #--- my $c = 2; foreach my $r ( 1 .. 7 ) { my $tc = build_text($top); $tmx->windowConfigure( "$r,$c", -sticky => 's', -window => $tc ); } $tmx->colWidth( $c, 20 ); $tmx->pack( -expand => 1, -fill => 'both' ); Tk::MainLoop; sub build_text { my $frame = shift; my $tc = $frame->Text( -bg => 'white', ); $tc->tagConfigure( 'blue', -foreground => 'blue', ); $tc->insert('insert', 'Text with '); $tc->insert('insert', ' blue ', 'blue'); $tc->insert('insert', ' word '); return $tc; }


Comment on Re: Tk Tablematrix configure word in a cell
Download Code
Re^2: Tk Tablematrix configure word in a cell
by welle (Beadle) on May 09, 2012 at 20:32 UTC

    Perfect! Thank you.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2014-09-22 22:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (205 votes), past polls