Hi all,

I'm trying to come up with the best approach for creating aesthetically pleasing windows that:

- Have labels whose bitmap has transparency (.png files loaded by DIBitmap)
- Don't exhibit any flicker
- Are layered windows (this seems to improve quality during animation/transparency)
- Support child windows that can be scrolled and don't flicker

Below is the code I've come up with so far (without bitmap labels). Is there anything else I should consider? Could I be doing something better?


########## CODE BEGIN

use strict;
use Win32::GUI qw(WS_CLIPCHILDREN);
use Win32::API;

use constant WS_EX_LAYERED => 0x00080000;
use constant LWA_COLORKEY  => 0x00000001;
use constant LWA_ALPHA     => 0x00000002;
use constant GWL_EXSTYLE   => -20;

my $main = Win32::GUI::Window->new
(
    -background ="" [153,0,0],
    -pushstyle => WS_CLIPCHILDREN,
    -text      => 'Test',
    -size      => [500,500],
);

my $setLayeredWindowAttributes = Win32::API->new('user32', 'SetLayeredWindowAttributes', 'LLIN', 'I');
my $winstyle = $main->GetWindowLong(GWL_EXSTYLE);
$winstyle = $winstyle | WS_EX_LAYERED;
$main->SetWindowLong(GWL_EXSTYLE, $winstyle || WS_EX_LAYERED);
$setLayeredWindowAttributes->Call($main->{-handle}, 0, 255, LWA_ALPHA);

my $OK = $main->AddButton
(
    -name => 'OK',
    -text => 'OK',
    -size => [80,25],
    -pos  => [10,10],
);

$main->Center();
$main->Show();
Win32::GUI::Dialog();

########## CODE END


Thanks,
Rob
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
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