Hello Guys, I have a problem using Perl TK. I wanna arrange my buttons and entry's using "pack". I would like to have my button under the "third" entry not after all my entry lines. Is using "pack" the way to go? And also how can i call another perl script in the GUI and save the outputs inside a variable. qx() command is not working. I am new to this language and i would appreciate some advices/solutions. Thank you in advance!

#!/usr/local/bin/perl -w use strict; use Tk; use Tk::ProgressBar; # Main Window my $mw = new MainWindow; $mw->geometry("1600x900"); #GUI Building Area my $label = $mw ->Label (-text => "first", -foreground => "blue", -fon +t => "Arial 7") ->pack(-fill => 'x'); $label = $mw ->Label (-text => "second", -foreground => "blue", -fo +nt => "Arial 12") ->pack(-fill => 'x'); $label = $mw ->Label (-text => "third", -foreground => "blue", -fon +t=> "Arial 10") ->pack (-side => 'left', -anchor => 'nw', -ipadx => ' +50', -fill => 'x'); $label = $mw ->Label (-text => "forth", -foreground => "blue", -fon +t=> "Arial 10")->pack (-side => 'left', -anchor => 'nw', -ipadx => '1 +50', -fill => 'x'); $label = $mw ->Label (-text => "fifth", -foreground => "blue", -fon +t => "Arial 10")->pack (-side => 'left', -anchor => 'nw', -ipadx => ' +150', -fill => 'x'); $label = $mw ->Label (-text => "last", -foreground => "blue", -font +=> "Arial 10")->pack (-side => 'left', -anchor => 'nw', -ipadx => '15 +0', -fill => 'x'); ############################################### # # Creating the buttons # ############################################### my $dir; my $path_dir; # Create the car folders button my $cf = $mw->Button( -text => 'Create car folders', -bac => 'lightblue', -width => '17', -command => \&push_button)->pack(-side => 'left'); MainLoop;

In reply to Perl TK GUI! by negativ_m

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.