CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Tk Module main window size

 



airo
stranger

Oct 20, 2001, 9:54 AM

Post #1 of 5 (967 views)
Tk Module main window size Can't Post

I'm trying to have the main window size to the screen size
here is what I have:
use strict;
use Tk;

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

MainLoop;

This won't work but if I do this it's fine
use strict;
use Tk;

my $mw = MainWindow->new;
#my $width = $mw->screenwidth();
#my $height = $mw->screenheight();
$mw->geometry('1024x768+0+0');
$mw->title("WOProj");

MainLoop;
The problem is the variables and I've tried all the quoting I can think of.
any ideas????
thanks
paul



mhx
Enthusiast / Moderator

Oct 20, 2001, 10:04 AM

Post #2 of 5 (966 views)
Re: Tk Module main window size [In reply to] Can't Post

Variable interpolation is a bit difficult here, because $widthx instead of $width will be treated as an identifier. The following code works:

Code
use strict; 
use Tk;

my $mw = MainWindow->new;
my $width = $mw->screenwidth();
my $height = $mw->screenheight();
$mw->geometry("${width}x${height}+0+0");
$mw->title("WOProj");

MainLoop;

Hope this helps.

-- Marcus


Code
s$$ab21b8d15c3d97bd6317286d$;$"=547269736;split'i',join$,,map{chr(($*+= 
($">>=1)&1?-hex:hex)+0140)}/./g;$"=chr$";s;.;\u$&;for@_[0,2];print"@_,"



(This post was edited by mhx on Oct 20, 2001, 12:19 PM)


airo
stranger

Oct 20, 2001, 1:21 PM

Post #3 of 5 (963 views)
Re: Tk Module main window size [In reply to] Can't Post

Marcus,

Where can I find more info about identifers and quoting?

thanks
paul



mhx
Enthusiast / Moderator

Oct 20, 2001, 1:31 PM

Post #4 of 5 (962 views)
Re: Tk Module main window size [In reply to] Can't Post

Perhaps these links into the manpages of Perl may be helpful:

Gory details of parsing quoted constructs
Interpolation Traps

-- Marcus


Code
s$$ab21b8d15c3d97bd6317286d$;$"=547269736;split'i',join$,,map{chr(($*+= 
($">>=1)&1?-hex:hex)+0140)}/./g;$"=chr$";s;.;\u$&;for@_[0,2];print"@_,"



airo
stranger

Oct 20, 2001, 7:33 PM

Post #5 of 5 (959 views)
Re: Tk Module main window size [In reply to] Can't Post

thanks I'll read over perlop and perltrap

paul


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives