From: Mattia B. <mat...@li...> - 2006-11-02 19:21:27
|
On Thu, 02 Nov 2006 12:17:12 +0200 Peter Gordon <pe...@pg...> wrote: Hi, > I am using pp (the perl packager) to build an executable perl program > for distribution. > > I need access to an icon from the distribution, so I get the contents > and add the file to the MemoryFsHandler. From there, I try to install > the icon using Wx:Icon::LoadFile. On startup, the program complains that > the icon "memory:my.ico" is not available.D oes Wx:Icon::LoadFile allow > files to be added via VFS. If not, how do I add an Icon? > > > This is a small segment of the code: > > Wx::FileSystem::AddHandler( Wx::MemoryFSHandler->new ); > Wx::MemoryFSHandler::AddTextFile( 'my.ico', $iconFile); > $result = $icon->LoadFile("memory:my.ico",wxBITMAP_TYPE_ICO) ; You can't use LoadFile with VFS. You can use an in-memory filehandle (open my $fh, '<', \$iconFile) and pass that filehandle to LoadFile. You can also use IO::Scalar or similar. HTH Mattia |