Bojan Jovanovic <bojan.jovanovic.gtech@...> writes:
>
>
> I have a weird problem with pyInstaller + pySide.
>
> The problem is when I try to compile this code which is a simple systray icon
with a menu that reads its icon from a .ico file in pyinstaller the icon is
invisible or can not be displayed, the same code run from .py is read and
displayed accordingly.
> I am busting my head over this for the whole day today, and I can't get over
it.
>
>
>
> SOURCE:
>
Bojan Jovanovic,
I do not know what operating system that you are trying to freeze against.
"PyInstaller is a program that converts (packages) Python programs
into stand-alone executables, under Windows, Linux, and Mac OS X."
http://www.pyinstaller.org/
My general impression is that icons work differently
among Mac, Windows, and Linux Desktops.
I use windows and cx_Freeze.
In my experience, I have found that I when
freeze a Python PySide application on Windows,
I need to reference the 'icon' twice by doing the following.
1. Embed the 'icon' in the frozen Python executable
2. Call the 'icon' from Python PySide source code
When I DO NOT freeze a Python Pyside application,
then I only need to do the one item.
2. Call the 'icon' from Python PySide source code.
I wrote, part of the following Wiki Page ...
Packaging PySide applications on Windows
cx_Freeze
http://developer.qt.nokia.com/wiki/Packaging_PySide_applications_on_Windows
and the words ...
"
On Windows, note that the —icon yourapptaskgroup.ico parameter
[ of the Python PySide freezing command line ]
will insert the icon into the final executable: yourapp.exe.
This will be the icon that represents a task bar group that is
a stack of applications (and not an individual application).
To implement application icons, add statements in your Python PySide
code that use the setWindowIcon method. (Yes, this ALSO must be done.)
"
Looking at your code placed above
".trayIcon.setIcon ..."
the situation seems that you are performing #2
2. Call the 'icon' from Python PySide source code
Try, also performing #1 (using PyInstaller)
1. Embed the 'icon' in the frozen Python executable
Hope this helps.
Andre Mikulec
_______________________________________________
PySide mailing list
[email protected]
http://lists.pyside.org/listinfo/pyside