Manpage of GridLayout
use Win32::GUI::
use Win32::GUI::GridLayout;
# 1. make a "static" grid
$grid = new Win32::GUI::GridLayout(400, 300, 3, 3, 0, 0);
$win = new Win32::GUI::Window(
$win->AddLabel(
-name => "label1",
-text => "Label 1",
-width => $grid->width(35),
-height => $grid->height(11),
-left => $grid->col(1, "left"),
-top => $grid->row(1, "top"),
);
# 2. make a "dynamic" grid
$grid = apply Win32::GUI::GridLayout($win, 3, 3, 0, 0);
$win->AddLabel(
-name => "label1",
-text => "Label 1",
);
$grid->add($win->label1, 1, 1, "left top");
$grid->recalc();
Example:
$grid->add($win->label1, 1, 1, "left top");
ALIGN can be "left", "center" or "right" (can be shortened to "l", "c", "r"); default is "left".
Note that for alignment to work properly, the width() and height() methods must have been previously called.
Example:
$win->AddLabel(
-name => "label1",
-text => "Label 1",
-width => $grid->width(35),
-height => $grid->height(11),
-left => $grid->col(1, "left"),
-top => $grid->row(1, "top"),
);
Example: see col().
Example:
sub Window_Resize {
$grid->recalc();
}
ALIGN can be "top", "center" or "bottom" (can be shortened to t, c, b); default is top.
Note that for alignment to work properly, the width() and height() methods must have been previously called.
Example: see col().
Example: see col().