Here's an odd problem.
I've written a win32::GUI application, but it will not maximize or minimize.
When I try, I see the window sort of blink, and I can see that the "resize" sub
has been called. If I comment out the Main_Resize sub, the program maximizes
and minimizes as expected.
Any ideas?
Here's the applicable bits of code:
my $menu = Win32::GUI::Menu->new(
'&File' => 'menuUP',
' > E&xit' => 'menuExit',
'&Control' => 'menuControl',
' > &Up' => 'menuUp',
'&Help' =>
'menuHelp',
' > &Help' => 'menuHelp',
);
my $mw = Win32::GUI::Window->new( -name => 'Main', -menu => $menu, -text =>
"Xen Mon", -size => [ 900, 900 ], -pos => [ 200, 200 ] );
my $sb = $mw->AddStatusBar();
my $lv = $mw->AddListView(-pos => [ 0, 0 ], -width => $mw->ScaleWidth(),
-height => $mw->ScaleHeight(), -hscroll => 1, -vscroll => 1);
$lv->InsertColumn( -item => 0, -text => "SILO/SERVER", -width => 120, -align
=>'left');
$lv->InsertColumn( -item => 1, -text => "USERS", -width => 50, -align
=>'right');
$lv->InsertColumn( -item => 2, -text => "SESS/DISC", -width => 75, -align
=>'right');
$lv->InsertColumn( -item => 3, -text => "MEM/TOT", -width => 75, -align
=>'right');
$lv->InsertColumn( -item => 4, -text => "UP", -width => 60, -align
=>'right');
$lv->InsertColumn( -item => 5, -text => 'LOAD%', -width => 50, -align
=>'right');
$lv->InsertColumn( -item => 6, -text => 'CPU%', -width => 50, -align
=>'right');
$lv->InsertColumn( -item => 7, -text => "", -width => 300, -align
=>'left');
$lv->Hook(NM_CUSTOMDRAW, \&lv_CustomDraw);
sub Main_Resize {
print "*** resize ***\n";
$sb->Move(0, $mw->ScaleHeight - $sb->Height);
$sb->Resize($mw->ScaleWidth, $sb->Height);
$lv->Resize($mw->ScaleWidth, $mw->ScaleHeight - $sb->Height -
$menu->Height);
$mw->Show;
return 1;
}
Ken Cornetet 812.482.8499
To err is human - to moo, bovine.
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs