negativ_m has asked for the wisdom of the Perl Monks concerning the following question:
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl TK GUI!
by zentara (Cardinal) on Feb 13, 2014 at 12:24 UTC | |
by negativ_m (Novice) on Feb 13, 2014 at 13:26 UTC | |
|
Re: Perl TK GUI!
by Anonymous Monk on Feb 13, 2014 at 11:47 UTC | |
by negativ_m (Novice) on Feb 13, 2014 at 12:08 UTC | |
by zentara (Cardinal) on Feb 13, 2014 at 12:26 UTC | |
by Anonymous Monk on Feb 13, 2014 at 12:52 UTC | |
by Anonymous Monk on Feb 13, 2014 at 12:12 UTC | |
by Anonymous Monk on Feb 13, 2014 at 11:58 UTC |