I struggled for an entire night trying to figure this out. ;-) Actually, I
was trying to mimic Winamp's skins and while I'm not quite there, I can
"skin" my GUI (okay, so it may be cheesy but it was fun to do).
Here's how I did it:
Create the window, create a label (the size of the window), fill the label
with the bitmap, create two labels with the -bitmap & -notify options set.
This allows the labels to respond to events but they don't actually
"appear", they're "hidden". If my memory serves me, I had to create the
elements in this exact order, otherwise the "hidden" label events would not
fire.
Code sample is below.
Jeremy Blonde
$Window = Win32::GUI::Window->new(
-name => "Window",
-text => $PREFS{TITLE},
-pos => [ $PREFS{LEFT}, $PREFS{TOP} ],
-size => [ $PREFS{WIDTH}, $PREFS{HEIGHT} ],
-topmost => $PREFS{ONTOP},
-resizable => 0,
);
$Window->AddLabel(
-name => "Background",
-pos => [ 0, 49 ],
-size => [ $Window->Width(), 35 ],
-bitmap => 1,
);
$Window->Background->SetImage($BACKGROUND);
# Creates the label for the About "button"
$Window->AddLabel(
-name => "About",
-pos =>
$PREFS{ABOUTLEFT} + $Window->Background->Left(),
$PREFS{ABOUTTOP} + $Window->Background->Top(),
],
-size => [ $PREFS{ABOUTWIDTH}, $PREFS{ABOUTHEIGHT} ],
-notify => 1,
-bitmap => 1,
);
# Creates the label for the Preferences "button"
$Window->AddLabel(
-name => "Preferences",
-pos =>
$PREFS{PREFSLEFT} + $Window->Background->Left(),
$PREFS{PREFSTOP} + $Window->Background->Top(),
],
-size => [ $PREFS{PREFSWIDTH}, $PREFS{PREFSHEIGHT} ],
-notify => 1,
-bitmap => 1,
);
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
Jeremy Aiyadurai
Sent: Friday, May 11, 2001 9:28 PM
To: [email protected]
Subject: [perl-win32-gui-users] Win32::GUI::Label
Hi all,
Thankyou for your help so far.
If you have not seen my previous email "about the console icons" please do
so.
my question is, I have made a bmp to cover the entire background of a
window. how do I make all the labels transparent, to blend with the
background image?
Thankyou
Jeremy
_______________________________________________
Perl-Win32-GUI-Users mailing list
[email protected]
http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com