Like this ?
#!/usr/bin/perl # http://perlmonks.org/?node_id=1185809 use strict; use warnings; use Tk; sub Tk::Separator { my ($self, %rest ) = @_; my $direction = delete $rest{'-orient'} // 'horizontal'; $self->Frame( %{ {%rest, -bg => 'black', $direction eq 'vertical' ? '-width' : '-height' => 2 } } ); } my $mw = MainWindow->new; $mw->Label( -text => 'top part', -height => 5, )->pack; $mw->Separator()->pack( -fill => 'x' ); $mw->Label( -text => 'bottom part', -height => 5, )->pack( -side => 'bottom'); $mw->Separator()->pack( -side => 'bottom', -fill => 'x' ); $mw->Label( -text => 'left part', -height => 5, -padx => 25, )->pack( -side => 'left'); $mw->Separator( -orient => 'vertical')->pack( -side => 'left', -fill = +> 'y' ); $mw->Label( -text => 'middle part', -height => 5, -padx => 25, )->pack( -side => 'left'); $mw->Separator( -orient => 'vertical')->pack( -side => 'left', -fill = +> 'y' ); $mw->Label( -text => 'right part', -height => 5, -padx => 25, )->pack( -side => 'left'); MainLoop;
In reply to Re^3: Looking for a standalone separator for Perl/Tk
by tybalt89
in thread Looking for a standalone separator for Perl/Tk
by kbrannen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |