RE: embedded windows and fillx
"Jack" <[email protected]> Sat, 6 Dec 2008 00:30:10 -0700
| Newsgroups | gmane.comp.lang.perl.tk |
|---|---|
| Message-ID | <[email protected]> |
Heres a hack:
##############################
use Tk;
use strict;
my $mw=tkinit;
my $text=$mw->Scrolled('Text',-scrollbars=>'ose')->pack(-fill=>'both',
-expand=>1);
$text->insert('end',"Try resizing this text widget");
my $canvas=$text->Canvas(-bg=>'red');
$text->windowCreate('end',-window=>$canvas);
$text->insert('end',"\n...it should resize");
$text->bind('<Configure>',\&resize_canvas);
MainLoop;
sub resize_canvas
{
#Resize to 90% of width and height
my ($w,$h) = ($text->width * .9, $text->height * .9);
$canvas->configure(-width=>$w, -height=>$h);
}
__END__
##############################
Jack
-----Original Message-----
From: [email protected] [mailto:[email protected]]
On Behalf Of Todd Littlefield
Sent: December-05-08 8:05 PM
To: [email protected]
Subject: embedded windows and fillx
Hello,
I've been playing with a script that uses a text widget with embedded
windows. The text widget is resizable and works as it should. The embedded
window will not grow do the same thing.
There is a -stretch but this is only for filling vertical space on the
line. Is there any way to have embedded windows grow with the text widget?
Thanks in advance!
- Todd
--++**==--++**==--++**==--++**==--++**==--++**==--++**==
ptk mailing list
[email protected]
https://mailman.stanford.edu/mailman/listinfo/ptk
No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.176 / Virus Database: 270.9.15/1833 - Release Date: 05/12/2008
7:08 PM
--++**==--++**==--++**==--++**==--++**==--++**==--++**==
ptk mailing list
[email protected]
https://mailman.stanford.edu/mailman/listinfo/ptk