-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the correct way to include Azure theme with pyinstaller exe? #55
Comments
You should add |
Clearly not, because this is Azure, not Sun-Valley. However, I don't know how to make it work with Pyinstaller, I haven't really used it. |
Yeah, my fault! I thought you were using sv_ttk |
For pyinstaller one folder (-D):
For pyinstaller one file (-F):
and add this to into the python file:
|
To make it work with pyinstaller, you need a folder called Azure with the Azure ttk theme in it. Than, replace the theme code with this: import darkdetect
def settheme(window):
window.tk.call("source", "Azure/azure.tcl")
window.tk.call("set_theme", "light")
def change_theme():
# NOTE: The theme's real name is azure-<mode>
if window.tk.call("ttk::style", "theme", "use") == "Azure/azure-dark":
# Set light theme
window.tk.call("set_theme", "light")
else:
# Set dark theme
window.tk.call("set_theme", "dark")
is_dark = darkdetect.isDark()
if is_dark:
change_theme()
settheme(root) And than, at least for autopytoexe select Additional Files > Add folder and than select Azure |
I have really tried many times but nothing seems to work. Please help me |
put --add-data Azure at the end of the file. It also requires darkdetect because it runs the default Windows theme |
Thank you. I don't really understand what you mean by darkdetect
…On Mon, Apr 29, 2024, 1:11 AM jhi2 ***@***.***> wrote:
put --add-data Azure at the end of the file. It also requires darkdetect
because it runs the default Windows theme
—
Reply to this email directly, view it on GitHub
<#55 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZ6JNLOYHSJL6RAUPC652ETY7WFZXAVCNFSM6AAAAAAUWP3KFSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBRG4YTANZXGI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
It is a module. Here is the full command: |
It works!
…On Sun, May 5, 2024, 7:17 PM jhi2 ***@***.***> wrote:
Thank you. I don't really understand what you mean by darkdetect
… <#m_8500901819248147988_>
On Mon, Apr 29, 2024, 1:11 AM jhi2 *@*.*> wrote: put --add-data Azure at
the end of the file. It also requires darkdetect because it runs the
default Windows theme — Reply to this email directly, view it on GitHub
<#55 (comment)
<#55 (comment)>>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AZ6JNLOYHSJL6RAUPC652ETY7WFZXAVCNFSM6AAAAAAUWP3KFSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBRG4YTANZXGI
<https://github.com/notifications/unsubscribe-auth/AZ6JNLOYHSJL6RAUPC652ETY7WFZXAVCNFSM6AAAAAAUWP3KFSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBRG4YTANZXGI>
. You are receiving this because you commented.Message ID: @.*>
It is a module. Here is the full command:
put darkdetect.py in the app dir and run
python -m pyinstaller somefile.py --add-data Azure --add-data darkdetect.py
—
Reply to this email directly, view it on GitHub
<#55 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZ6JNLJCTZPNMMPEZLQMT4DZAZZS3AVCNFSM6AAAAAAUWP3KFSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJUHEYDCNRYGQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Do you like the native theme support |
The Pyinstaller exe produces:
_tkinter.TclError: couldn't read file "azure.tcl": no such file or directory
The text was updated successfully, but these errors were encountered: