I'll assume the "Picture" is a bitmap or icon?
This works for a bitmap, and icon is just as easy.
Here's a sniplet.

BEGIN{
        our $bitmap;
}
die "file doesn't exist" unless( -e "mypicture.bmp" );
$bitmap = new Win32::GUI::Bitmap( "mypicture.bmp" )  or die "Error,
cannot load bitmap\n";
$win->AddButton(
       -name    => "mypicture",
       -bitmap   => $bitmap,
       -top     => 0,
       -left    => 0,
       -width   => 32,
       -height  => 32,
);

But be aware of a Win32::GUI flaw.  The $bitmap var must be kept around,
ie, global !
Also that the width and height should be set what "BitmapInfo" can
return so that its not clipped.



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
artem-konev
Sent: Friday, April 11, 2003 9:52 PM
To: perl-win32-gui-users@lists.sourceforge.net
Subject: [perl-win32-gui-users] Push Button with the picture (bitbtn)


Good Morning :))

I'm trying to make a button with a picture instead of text.... and the
third day I can't make such simple thing!!! :)) May be you can tell me
something?

And also I dont find possibility to put mask on textfield (such as
dd/dd/dddd for date input), so I've made it by hands in Change event,
but I can't get cursor position in textfield to put it on place. (by
default cursor stands in the begining of the field when i make
$textfield->Text($str), but i must put it in those place where it was
before
Change)

Thanks in advance...



-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The
debugger 
for complex code. Debugging C/C++ programs can leave you feeling lost
and 
disoriented. TotalView can help you find your way. Available on major
UNIX 
and Linux platforms. Try it free. www.etnus.com
_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users



Reply via email to