Using place method to set control location : Layout « GUI « Perl






Using place method to set control location

   

use Tk;

my $main = MainWindow->new;

$button1 = $main->Button(-text => 'Click Me!')->place(-x => 0, -y => 0);
$button1 = $main->Button(-text => 'Click Me!')->place(-x => 30, -y => 30);
$button1 = $main->Button(-text => 'Click Me!')->place(-x => 60, -y => 60);
$button1 = $main->Button(-text => 'Click Me!')->place(-x => 90, -y => 90);
$button1 = $main->Button(-text => 'Click Me!')->place(-x => 120, -y => 120);
$button1 = $main->Button(-text => 'Click Me!')->place(-x => 150, -y => 150);


MainLoop;

   
    
    
  








Related examples in the same category

1.Pack controls on a window
2.Pack left, right, both
3.Using pack to control widget placement
4.Control the fill
5.Layout control: fill
6.Layout controls: Pack to the top
7.Pack Bottom
8.Pack Left
9.Pack Right
10.Pack Top
11.Adding radio buttom to Frame
12.Relayout(pack) the controls