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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

'-padx' not working in new release

Status
Not open for further replies.

AMiSM

Technical User
Jan 26, 2006
128
US
I have this line in my code:

$mw = new MainWindow( -title=>"OSMtb Formatter",-padx=>5,-pady=>5 );

When I run the code, I get this:

Can't set -padx to `5' for MainWindow=HASH(0x1a48bdc): Bad option `-padx' at C:/Perl/site/lib/Tk/Configure.pm line 46.
> Terminated with exit code 255.

I just reinstalled ActivePerl. This code worked fine with the previous version. I looked in the release notes, but I can't see why this wouldn't work now.
 
-padx and -pady specify the space outside of a widget when packed against other widgets. MainWindow is not a widget but a window. It doesn't have any space around it to pad. Maybe you needed to use -ipadx and -ipady, which specify the padded space on the inside of a widget.

-------------
Kirsle.net | Kirsle's Programs and Projects
 
Nope, '-ipadx' and 'ipady' doesn't work. I've been using this app for weeks, and it worked just fine! It stopped working when I went to the most recent version.
Thanks for your insight, though, I'll look in that direction.
 
An idea: make the MainWindow then pack a frame in with -ipadx and -ipady (or -padx or -pady might work too), and put all your other widgets within the frame.

Code:
$mw = new MainWindow( -title=>"OSMtb Formatter");
my $mf = $mw->Frame->pack (-fill => 'both', -expand => 1, -padx => 5, -pady => 5);

# then pack your widgets in $mf instead of $mw

-------------
Kirsle.net | Kirsle's Programs and Projects
 
Yeah, I thought of the frame. It was just to make it look perdy, nothing special. I just omitted it from the code. Thanks, though. As usual, Kirsle, you're always helpful! :)
 
Judging by your first remark, I'm thinking that what was formerly permissible was deemed not a pure usage, so it was removed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top