Starting from an example off the web, I want to add these two lines so that they are left justified and vertical to each other. I've missed something. Attached is the complete program - I am just curious on how to fix the "Model File" and the "Range File" widgets. I know there are other issues...

#!/usr/bin/perl -w use Tk; use strict; # ********************** # Main() # ********************** my( $entry, $filename, $output, ); my $ver = "1.0.0"; my $mw = MainWindow->new; $mw->geometry("500x600"); $mw->title("GUI 6"); my $main_menu = $mw->Menu(); $mw->configure(-menu => $main_menu); # give the user a way to exit the script my $file_menu = $main_menu->cascade(-label=>" ", -underline => 0, -tea +roff=>0); $file_menu->command(-label=>"Exit", -underline=>0, -command => sub{exi +t}); # everyone needs a little help my $help_menu = $main_menu->cascade(-label => "Help", -underline => 0, + -tearoff => 0); $help_menu->command(-label => "Version", -underline => 0, -command => sub{$mw->messageBox(-message => "Versi +on: $ver", -type => "ok")}); $help_menu->command(-label => "About Program", -underline => 0, -comma +nd => \&show_about); my $pet_info_frame = $mw->Frame()->pack(-side => "top"); $pet_info_frame->Label(-text => "View?")->pack(-side => "top"); my $chk1 = "no"; my $chk2 = "no"; my $pet1_chk = $pet_info_frame->Checkbutton(-text => "Show All", -variable => \$chk1, -onvalue => "yes", -offvalue => "no")->pack(- +side => "right"); my $pet2_chk = $pet_info_frame->Checkbutton(-text => "Show Only Differ +ences", -variable => \$chk1, -onvalue => "yes", -offvalue => "no")->pack(- +side => "right"); my $model_info = $mw->Frame()->pack(-side => "left"); $model_info->Label(-text => "Model File : ")->pack(-side => "left"); my $model_info_frame = $mw->Frame()->pack(-side => "left"); my $entry1 = $model_info_frame->Entry( -width => 60, -textvariable => \$filename )->grid( $mw->Button( -text => "...", -command => sub { $filename = $mw->getOpenFile(-title => 'File Browser'); } ), ); $model_info = $mw->Frame()->pack(-side => "left"); my $range_info = $mw->Frame()->pack(-side => "left"); $range_info->Label(-text => "Range File : ")->pack(-side => "left"); my $range_info_frame = $mw->Frame()->pack(-side => "left"); my $entry2 = $range_info_frame->Entry( -width => 60, -textvariable => \$filename )->grid( $mw->Button( -text => "...", -command => sub { $filename = $mw->getOpenFile(-title => 'File Browser'); } ), ); my $button_frame = $mw->Frame()->pack(-side => "bottom"); $button_frame->Button(-text => "Ok", -command => \&update_output)->pac +k(); #my $output_frame = $mw->Frame()->pack(-side => "bottom"); #my $output_scroll = $output_frame->Scrollbar(); #my $output_text = $output_frame->Text(-yscrollcommand => ['set', $out +put_scroll]); #$output_scroll->configure(-command => ['yview', $output_text]); #$output_scroll->pack(-side => "bottom", -expand => "no", -fill => "y" +); #$output_text->pack(); sub update_output { if ( $chk1 eq "yes" ) { $output = "$output\nShow All"; } if ( $chk2 eq "yes" ) { $output = "$output\nShow Only Differences"; +} #$output_text->delete('0.0', 'end'); #$output_text->insert("end", $output); } sub show_about { my $help_win = $mw->Toplevel; $help_win->geometry("300x50"); $help_win->title("About Program"); my $help_msg = "This help page is an example of using multiple windo +ws."; $help_win->Label(-text => $help_msg)->pack(); $help_win->Button(-text => "Ok", -command => [$help_win => 'destroy' +])->pack(); } MainLoop;

Any help appreciated. Thanks in advance.


In reply to problems with frame widgets of tk by gibsonca

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.