Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I am writing a script that searches for a file and reports about it, but i am having problems designing the user interface. I am using Tk and the pack function for this. Here is the code i have so far:
use strict; use warnings; use Tk; my $mw = new MainWindow; $mw->geometry("400x400"); my $text = $mw->Text(-width=>15,-height=>3)->pack(-side=>'bottom',-anc +hor=>'w',-padx=>20,-pady=>10); my $label = $mw->Label(-text=>"File?",-anchor=>'w')->pack(-side=>'left +',-anchor=>'n',-padx=>20,-pady,10); my $entry = $mw->Entry->pack(-side=>'left',-anchor=>'n',-padx=>20,-pad +y=>10); my $button = $mw->Button(-text => "search!",-width=>30)->pack(-side => + 'left',-anchor=>'n',-padx=>20,-pady=>10); MainLoop;
As you can see the textarea is located all the way to the bottom while i want it just below the other widgets. So all i need is to loose some vertical space but i am unable to do this. Sorry for my poor engish, please advice.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tk design user interface
by Tux (Canon) on Jan 23, 2020 at 12:59 UTC | |
by Anonymous Monk on Jan 23, 2020 at 13:25 UTC | |
|
Re: Tk design user interface
by tybalt89 (Monsignor) on Jan 23, 2020 at 13:58 UTC | |
by Anonymous Monk on Jan 23, 2020 at 18:50 UTC |