Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tk module geometry window size question 1

Status
Not open for further replies.

hd65

Technical User
Aug 17, 2000
27
US
Hi,
Here is waht I have:
use strict;
use Tk;

my $mw = MainWindow->new;
my $width = "1024";
my $height = "768";
$mw->geometry("$widthx$height+0+0");
$mw->title("WOProj");

MainLoop;

The geometry line should make the window width=1024 height=768.
but I can't get the quotes right.
the way it is the first variable is $widthx which is not right....How would I set this line to
$mw->geometry("1024x768+0+0");
by the way this works..Just not with the variables
thanks
paul
 
Try adding {} around the $width variable like this:

$mw->geometry("${width}x$height+0+0");
 
Good answer raider. Using curly brackets is a trick that not many people know.

Paul: Make sure that the $ stays OUTSIDE of the brackets, otherwise it won't work right. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Thanks
It worked great.
paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top