From: Christophe M. <mas...@me...> - 2004-07-07 07:16:54
|
Hi Arnold, Le dim 04/07/2004 =E0 18:23, Dean Arnold a =E9crit : > Google wasn't much help, so please bear with a poor > wxPerl newbie crossing over from the pTk chaos... >=20 > 1) How can I change the little left-hand corner window icons > in Win32 to my own custom icon ? >=20 I have recently tried this: In "OnInit::MyApp" Wx::InitAllImageHandlers(); In "MyFrame" or whatever package is your main top window: keep only the image type that suits your needs: use Wx qw(wxBITMAP_TYPE_BMP wxBITMAP_TYPE_GIF wxBITMAP_TYPE_JPEG wxBITMAP_TYPE_PNG wxBITMAP_TYPE_TIF wxBITMAP_TYPE_XPM ); =20 In "MyFrame" constructor.=20 Replace "path-to-the-image-file/icon.xpm" with your own image file path & name. my $icon =3D Wx::Icon->new(); my $bitmap =3D Wx::Bitmap->new( "path-to-the-image-file/icon.xpm", wxBITMAP_TYPE_XPM ); $icon->CopyFromBitmap($bitmap); $this->SetIcon( $icon ); That's it ! The supported image type are: wxBITMAP_TYPE_BMP Load a Windows bitmap file.=20 wxBITMAP_TYPE_GIF Load a GIF bitmap file.=20 wxBITMAP_TYPE_JPEG Load a JPEG bitmap file.=20 wxBITMAP_TYPE_PNG Load a PNG bitmap file.=20 wxBITMAP_TYPE_PCX Load a PCX bitmap file.=20 wxBITMAP_TYPE_PNM Load a PNM bitmap file.=20 wxBITMAP_TYPE_TIF Load a TIFF bitmap file.=20 wxBITMAP_TYPE_XPM Load a XPM bitmap file.=20 wxBITMAP_TYPE_ICO Load a Windows icon file (ICO).=20 wxBITMAP_TYPE_CUR Load a Windows cursor file (CUR).=20 wxBITMAP_TYPE_ANI Load a Windows animated cursor file (ANI).=20 wxBITMAP_TYPE_ANY Will try to autodetect the format.=20 Obviously, ICO, CUR and ANI are only supported under MS Windows > 2) Any pointers to docs/examples of using async I/O > events with wxPerl much appreciated. I've got a DBI > driver that supports async operations and a simple > polling i/f, works nicely w/ pTk; hopefully, there are > equivalent hooks in wxPerl ? Are threads a viable > solution in wxPerl (my DBI driver is also thread safe) ? I can suggest you to use the "Event" CPAN module, which is not wxPerl related but works fine to handle this kind of things. Christophe Massaloux. mas...@me... |