Hello,

I'm drawing stuff in a window, then minimizing the window to the bottom
part of the screen using the Windows underscore symbol.  When my mouse
hovers over the minimized icon, the content is still there.  When I click
on the icon to reopen the window, the content is gone.

Simple example included below, where the top half of the window is painted
green, the bottom part red.

I assume it's some magic to do with dc, onEvent, save, restore etc., but I
can't figure it out.

In case my setup matters:

Windows 7 SP1
CYGWIN_NT-6.1-WOW64 1.7.17(0.262/5/3) 2012-10-19 14:39
perl 5.14
Win32::GUI v1.06 (GUI.pm 1.69)

Thanks,
Soren

#!perl
use strict;
use warnings;
use Win32::GUI();

my $WIDTH  = 400;
my $HEIGHT = 600;

my $win = Win32::GUI::Window->new(
    -name => 'win', -width => $WIDTH, -height => $HEIGHT );

$win->Show();
&make_example();
Win32::GUI::Dialog();
exit;

sub make_example
{
  my $dc    = $win->GetDC;
  my $brush = new Win32::GUI::Brush( [32, 128, 32] );
  my $old_brush = $dc->SelectObject($brush);
  $dc->Rectangle(0, 0, $WIDTH, $HEIGHT/2);
  $brush = new Win32::GUI::Brush( [178, 63, 63] );
  $dc->SelectObject($brush);
  $dc->Rectangle(0, $HEIGHT/2, $WIDTH, $HEIGHT);
  $dc->SelectObject($old_brush) if defined ($old_brush);
}

sub win_Terminate { -1; }
------------------------------------------------------------------------------
Own the Future-Intel® Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game 
on Steam. $5K grand prize plus 10 genre and skill prizes. 
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
http://perl-win32-gui.sourceforge.net/

Reply via email to