Laurent
unread,Dec 13, 2009, 10:59:51 AM12/13/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to PyInstaller
Hello,
I had an issue before with either py2exe or pyinstaller.
Packing matplotlib toolbar in a single file .exe make disappear most
of the icons on this toolbar.
The issue is only seen with .svg icon file.
.png are ok.
(I use also pyqt)
Here is dirty patch, add this to your own code:
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg
as NavigationToolbar
class VMToolbar(NavigationToolbar):
def __init__(self, plotCanvas, parent):
NavigationToolbar.__init__(self, plotCanvas, parent)
def _icon(self, name):
#dirty hack to use exclusively .png and thus avoid .svg usage
#because .exe generation is problematic with .svg
name = name.replace('.svg','.png')
return QIcon(os.path.join(self.basedir, name))
Well this is far from perfect but at least it avoid the issue if your
are like me in a urge to release a .exe :)
Cheers,
Laurent