in reply to Tk design user interface
Either
#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11111771 use warnings; use Tk; my $mw = new MainWindow; #$mw->geometry("400x400"); my $text = $mw->Text(-width=>15,-height=>3 )->pack(-side=>'bottom',-anchor=>'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,-pady=>10); my $button = $mw->Button(-text => "search!",-width=>30 )->pack(-side => 'left',-anchor=>'n',-padx=>20,-pady=>10); MainLoop;
Or
#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11111771 use warnings; use Tk; my $mw = new MainWindow; $mw->geometry("400x400"); my $frame = $mw->Frame->pack; my $label = $frame->Label(-text=>"File?",-anchor=>'w' )->pack(-side=>'left',-anchor=>'n',-padx=>20,-pady,10); my $entry = $frame->Entry ->pack(-side=>'left',-anchor=>'n',-padx=>20,-pady=>10); my $button = $frame->Button(-text => "search!",-width=>30 )->pack(-side => 'left',-anchor=>'n',-padx=>20,-pady=>10); my $text = $mw->Text(-width=>15,-height=>3 )->pack(-side=>'top',-anchor=>'w',-padx=>20,-pady=>10); MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Tk design user interface
by Anonymous Monk on Jan 23, 2020 at 18:50 UTC |