O'Reilly logo

Penetration Testing with Perl by Swizec Teller

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Widgets and the grid

We now have our first widget, which is a text label widget that displays the text Host:. All widgets, as mentioned in the previous subsection, are laid out in the window using the grid layout style. The grid is a matrix-like layout, which uses columns and rows, which are simply denoted as integers, in order to place the widgets into the window. For instance, we can add a text label widget using the Label() method of the $mw object, as shown in the following code:

$mw->Label(
 -text => "Host: ",
 -foreground=>"light blue",
 -background=>"black"
 )->grid(
  -row=>1, 
  -column=>0,
  -padx=>5
);

This method takes many arguments, including which text to use, the foreground or the color of the text, and the background or the highlight color ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required