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 ...